// source --> https://www.opiceblum.com.br/en/wp-content/plugins/modern-events-calendar-lite/assets/js/frontend.js?ver=5.13.6 // MEC Single Event Displayer var mecSingleEventDisplayer = { getSinglePage: function (id, occurrence, time, ajaxurl, layout, image_popup) { if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-modal-preloader'); jQuery.ajax({ url: ajaxurl, data: "action=mec_load_single_page&id=" + id + (occurrence != null ? "&occurrence=" + occurrence : "") + (time != null ? "&time=" + time : "") + "&layout=" + layout, type: "get", success: function (response) { jQuery('.mec-modal-result').removeClass("mec-modal-preloader"); //lity(response); jQuery.featherlight(response); setTimeout(function() { if(typeof grecaptcha !== 'undefined' && jQuery('#g-recaptcha').length > 0) { grecaptcha.render("g-recaptcha", { sitekey: mecdata.recapcha_key }); } }, 1000); if (image_popup != 0) { if (jQuery('.featherlight-content .mec-events-content a img').length > 0) { jQuery('.featherlight-content .mec-events-content a img').each(function () { jQuery(this).closest('a').attr('data-featherlight', 'image'); }); } } else { jQuery('.featherlight-content .mec-events-content a img').remove(); jQuery('.featherlight-content .mec-events-content img').remove(); } if (typeof mecdata.enableSingleFluent != 'undefined' && mecdata.enableSingleFluent) { mecFluentSinglePage(); } }, error: function () {} }); } }; // MEC SEARCH FORM PLUGIN (function ($) { $.fn.mecSearchForm = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, search_form_element: '', atts: '', callback: function () {} }, options); $("#mec_sf_category_" + settings.id).on('change', function (e) { search(); }); $("#mec_sf_location_" + settings.id).on('change', function (e) { search(); }); $("#mec_sf_organizer_" + settings.id).on('change', function (e) { search(); }); $("#mec_sf_speaker_" + settings.id).on('change', function (e) { search(); }); $("#mec_sf_tag_" + settings.id).on('change', function (e) { search(); }); $("#mec_sf_label_" + settings.id).on('change', function (e) { search(); }); $("#mec_sf_s_" + settings.id).on('change', function (e) { search(); }); $("#mec_sf_address_s_" + settings.id).on('change', function (e) { search(); }); var mec_sf_month_selector = "#mec_sf_month_" + settings.id; var mec_sf_year_selector = "#mec_sf_year_" + settings.id; mec_sf_month_selector += (', ' + mec_sf_year_selector); $(mec_sf_month_selector).on('change', function (e) { if($(mec_sf_year_selector).find('option:eq(0)').val() == 'none') { var mec_month_val = $(mec_sf_month_selector).val(); var mec_year_val = $(mec_sf_year_selector).val(); if((mec_month_val != 'none' && mec_year_val != 'none') || ((mec_month_val == 'none' && mec_year_val == 'none'))) search(); } else search(); }); $("#mec_sf_event_type_" + settings.id).on('change', function (e) { search(); }); $("#mec_sf_event_type_2_" + settings.id).on('change', function (e) { search(); }); $("#mec_sf_attribute_" + settings.id).on('change', function (e) { search(); }); if (settings.fields && settings.fields != null && settings.fields.length > 0) { for (var k in settings.fields) { $("#mec_sf_" + settings.fields[k] + '_' + settings.id).on('change', function (e) { search(); }); } } function search() { var s = $("#mec_sf_s_" + settings.id).length ? $("#mec_sf_s_" + settings.id).val() : ''; var address = $("#mec_sf_address_s_" + settings.id).length ? $("#mec_sf_address_s_" + settings.id).val() : ''; var category = $("#mec_sf_category_" + settings.id).length ? $("#mec_sf_category_" + settings.id).val() : ''; var location = $("#mec_sf_location_" + settings.id).length ? $("#mec_sf_location_" + settings.id).val() : ''; var organizer = $("#mec_sf_organizer_" + settings.id).length ? $("#mec_sf_organizer_" + settings.id).val() : ''; var speaker = $("#mec_sf_speaker_" + settings.id).length ? $("#mec_sf_speaker_" + settings.id).val() : ''; var tag = $("#mec_sf_tag_" + settings.id).length ? $("#mec_sf_tag_" + settings.id).val() : ''; var label = $("#mec_sf_label_" + settings.id).length ? $("#mec_sf_label_" + settings.id).val() : ''; var month = $("#mec_sf_month_" + settings.id).length ? $("#mec_sf_month_" + settings.id).val() : ''; var year = $("#mec_sf_year_" + settings.id).length ? $("#mec_sf_year_" + settings.id).val() : ''; var event_type = $("#mec_sf_event_type_" + settings.id).length ? $("#mec_sf_event_type_" + settings.id).val() : ''; var event_type_2 = $("#mec_sf_event_type_2_" + settings.id).length ? $("#mec_sf_event_type_2_" + settings.id).val() : ''; var attribute = $("#mec_sf_attribute_" + settings.id).length ? $("#mec_sf_attribute_" + settings.id).val() : ''; if (year === 'none' && month === 'none') { year = ''; month = ''; } var addation_attr = ''; if (settings.fields && settings.fields != null && settings.fields.length > 0) { for (var k in settings.fields) { var field = '#mec_sf_' + settings.fields[k] + '_' + settings.id; var val = $(field).length ? $(field).val() : ''; addation_attr += '&sf[' + settings.fields[k] + ']=' + val; } } var atts = settings.atts + '&sf[s]=' + s + '&sf[address]=' + address + '&sf[month]=' + month + '&sf[year]=' + year + '&sf[category]=' + category + '&sf[location]=' + location + '&sf[organizer]=' + organizer + '&sf[speaker]=' + speaker + '&sf[tag]=' + tag + '&sf[label]=' + label + '&sf[event_type]=' + event_type + '&sf[event_type_2]=' + event_type_2 + '&sf[attribute]=' + attribute + addation_attr; settings.callback(atts); } }; }(jQuery)); jQuery(document).ready(function($) { // Select2 jQuery(".mec-fes-form-cntt #mec-location select, .mec-fes-form-cntt #mec-organizer select").select2(); // Location select2 jQuery("#mec_location_id").select2(); // Organizer Select2 jQuery("#mec_organizer_id").select2(); }); // MEC FULL CALENDAR PLUGIN (function ($) { $.fn.mecFullCalendar = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', ajax_url: '', sf: {}, skin: '', }, options); // Set onclick Listeners setListeners(); mecFluentCurrentTimePosition(); mecFluentCustomScrollbar(); var sf; function setListeners() { // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(); } }); } // Add the onclick event $("#mec_skin_" + settings.id + " .mec-totalcal-box .mec-totalcal-view span:not(.mec-fluent-more-views-icon)").on('click', function (e) { e.preventDefault(); var skin = $(this).data('skin'); var mec_month_select = $('#mec_sf_month_' + settings.id); var mec_year_select = $('#mec_sf_year_' + settings.id); if(mec_year_select.val() == 'none') { mec_year_select.find('option').each(function() { var option_val = $(this).val(); if(option_val == mecdata.current_year) mec_year_select.val(option_val); }); } if(mec_month_select.val() == 'none') { mec_month_select.find('option').each(function() { var option_val = $(this).val(); if(option_val == mecdata.current_month) mec_month_select.val(option_val); }); } if(skin == 'list' || skin == 'grid' || skin == 'agenda') { var mec_filter_none = ''; if(mec_month_select.find('.mec-none-item').length == 0) mec_month_select.prepend(mec_filter_none); if(mec_year_select.find('.mec-none-item').length == 0) mec_year_select.prepend(mec_filter_none); } else { if(mec_month_select.find('.mec-none-item').length != 0) mec_month_select.find('.mec-none-item').remove(); if(mec_year_select.find('.mec-none-item').length != 0) mec_year_select.find('.mec-none-item').remove(); } $("#mec_skin_" + settings.id + " .mec-totalcal-box .mec-totalcal-view span").removeClass('mec-totalcalview-selected') $(this).addClass('mec-totalcalview-selected'); if ($(this).closest('.mec-fluent-more-views-content').length > 0) { $('.mec-fluent-more-views-icon').addClass('active'); $('.mec-fluent-more-views-content').removeClass('active'); } else { $('.mec-fluent-more-views-icon').removeClass('active'); } loadSkin(skin); }); } function loadSkin(skin) { // Set new Skin settings.skin = skin; // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_full_calendar_switch_skin&skin=" + skin + "&" + settings.atts + "&apply_sf_date=1&sed=" + settings.sed_method, dataType: "json", type: "post", success: function (response) { $("#mec_full_calendar_container_" + settings.id).html(response); // Remove loader $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Focus First Active Day mecFocusDay(settings); mecFluentCurrentTimePosition(); mecFluentCustomScrollbar(); }, error: function () {} }); } function search() { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_full_calendar_switch_skin&skin=" + settings.skin + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { $("#mec_full_calendar_container_" + settings.id).html(response); // Remove loader $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Focus First Active Day mecFocusDay(settings); // Focus First Active Week mec_focus_week(settings.id); mecFluentCurrentTimePosition(); mecFluentCustomScrollbar(); }, error: function () {} }); } }; }(jQuery)); // MEC YEARLY VIEW PLUGIN (function ($) { $.fn.mecYearlyView = function (options) { var active_year; // Default Options var settings = $.extend({ // These are the defaults. today: null, id: 0, events_label: 'Events', event_label: 'Event', year_navigator: 0, atts: '', next_year: {}, sf: {}, ajax_url: '', }, options); mecFluentYearlyUI(settings.id, settings.year_id); // Initialize Year Navigator if (settings.year_navigator) initYearNavigator(); // Set onclick Listeners setListeners(); // load more $(document).on("click", "#mec_skin_events_" + settings.id + " .mec-load-more-button", function () { var year = $(this).parent().parent().parent().data('year-id'); loadMoreButton(year); }); // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; active_year = $('.mec-yearly-view-wrap .mec-year-navigator').filter(function () { return $(this).css('display') == "block"; }); active_year = parseInt(active_year.find('h2').text()); search(active_year); } }); } function initYearNavigator() { // Add onclick event $("#mec_skin_" + settings.id + " .mec-load-year").off("click").on("click", function() { var year = $(this).data("mec-year"); setYear(year); }); } function search(year) { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_yearly_view_load_year&mec_year=" + year + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { active_year = response.current_year.year; // Append Year $("#mec_skin_events_" + settings.id).html('
' + response.year + '
'); // Append Year Navigator $("#mec_skin_" + settings.id + " .mec-yearly-title-sec").append('
' + response.navigator + '
'); // Re-initialize Year Navigator initYearNavigator(); // Set onclick Listeners setListeners(); // Toggle Year toggleYear(response.current_year.id); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); mecFluentYearlyUI(settings.id, active_year); mecFluentCustomScrollbar(); }, error: function () {} }); } function setYear(year, do_in_background) { if (typeof do_in_background === "undefined") do_in_background = false; var year_id = year; active_year = year; // Year exists so we just show it if ($("#mec_yearly_view_year_" + settings.id + "_" + year_id).length) { // Toggle Year toggleYear(year_id); mecFluentCustomScrollbar(); } else { if (!do_in_background) { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); } $.ajax({ url: settings.ajax_url, data: "action=mec_yearly_view_load_year&mec_year=" + year + "&" + settings.atts + "&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { // Append Year $("#mec_skin_events_" + settings.id).append('
' + response.year + '
'); // Append Year Navigator $("#mec_skin_" + settings.id + " .mec-yearly-title-sec").append('
' + response.navigator + '
'); // Re-initialize Year Navigator initYearNavigator(); // Set onclick Listeners setListeners(); if (!do_in_background) { // Toggle Year toggleYear(response.current_year.id); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Set Year Filter values in search widget $("#mec_sf_year_" + settings.id).val(year); } else { $("#mec_yearly_view_year_" + settings.id + "_" + response.current_year.id).hide(); $("#mec_year_navigator_" + settings.id + "_" + response.current_year.id).hide(); } mecFluentYearlyUI(settings.id, year); if (!do_in_background) { mecFluentCustomScrollbar(); } }, error: function () {} }); } } function toggleYear(year_id) { // Toggle Year Navigator $("#mec_skin_" + settings.id + " .mec-year-navigator").hide(); $("#mec_year_navigator_" + settings.id + "_" + year_id).show(); // Toggle Year $("#mec_skin_" + settings.id + " .mec-year-container").hide(); $("#mec_yearly_view_year_" + settings.id + "_" + year_id).show(); } var sf; function setListeners() { // Single Event Method if (settings.sed_method != '0') { sed(); } // Yearly view $("#mec_skin_" + settings.id + " .mec-has-event a").on('click', function(e) { e.preventDefault(); var des = $(this).attr('href'); var visible = $(des).is(':visible'); if(!visible) { var year = $(des).parent().parent().parent().data('year-id'); while(!visible) { loadMoreButton(year); visible = $(des).is(':visible'); } } $('.mec-events-agenda').removeClass('mec-selected'); $(des).closest('.mec-events-agenda').addClass('mec-selected'); var scrollTopVal = $(des).closest('.mec-events-agenda').offset().top - 35; if($(this).closest('.mec-fluent-wrap').length > 0) { var parent = jQuery(this).closest('.mec-fluent-wrap').find('.mec-yearly-agenda-sec'); scrollTopVal = parent.scrollTop() + ($(des).closest('.mec-events-agenda').offset().top - parent.offset().top); jQuery(this).closest('.mec-fluent-wrap').find('.mec-yearly-agenda-sec').getNiceScroll(0).doScrollTop(scrollTopVal - 15, 120); } else { $('html, body').animate({ scrollTop: scrollTopVal }, 300); } }); } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-agenda-event-title a").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } function loadMoreButton(year) { var $max_count, $current_count = 0; $max_count = $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-yearly-max").data('count'); $current_count = $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-util-hidden").length; if ($current_count > 10) { for (var i = 0; i < 10; i++) { $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-util-hidden").slice(0, 2).each(function () { $(this).removeClass('mec-util-hidden'); }); } } if ($current_count < 10 && $current_count != 0) { for (var j = 0; j < $current_count; j++) { $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-util-hidden").slice(0, 2).each(function () { $(this).removeClass('mec-util-hidden'); $("#mec_yearly_view_year_" + settings.id + "_" + year + " .mec-load-more-wrap").css('display', 'none'); }); } } } }; }(jQuery)); // MEC MONTHLY VIEW PLUGIN (function ($) { $.fn.mecMonthlyView = function (options) { var active_month; var active_year; // Default Options var settings = $.extend({ // These are the defaults. today: null, id: 0, events_label: 'Events', event_label: 'Event', month_navigator: 0, atts: '', active_month: {}, next_month: {}, sf: {}, ajax_url: '', }, options); // Initialize Month Navigator if (settings.month_navigator) initMonthNavigator(); active_month = settings.active_month.month; active_year = settings.active_month.year; // Set onclick Listeners setListeners(); // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(active_year, active_month); } }); } function initMonthNavigator() { // Remove the onclick event $("#mec_skin_" + settings.id + " .mec-load-month").off("click"); // Add onclick event $("#mec_skin_" + settings.id + " .mec-load-month").on("click", function () { var year = $(this).data("mec-year"); var month = $(this).data("mec-month"); setMonth(year, month, false, true); }); } function search(year, month) { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_monthly_view_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { active_month = response.current_month.month; active_year = response.current_month.year; // Append Month $("#mec_skin_events_" + settings.id).html('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-monthly-view-month-navigator-container").html('
' + response.navigator + '
'); // Append Events Side $("#mec_skin_" + settings.id + " .mec-calendar-events-side").html('
' + response.events_side + '
'); // Re-initialize Month Navigator initMonthNavigator(); // Set onclick Listeners setListeners(); // Toggle Month toggleMonth(response.current_month.id); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); }, error: function () {} }); } function setMonth(year, month, do_in_background, navigator_click) { if (typeof do_in_background === "undefined") do_in_background = false; navigator_click = navigator_click || false; var month_id = year + "" + month; if (!do_in_background) { active_month = month; active_year = year; } // Month exists so we just show it if ($("#mec_monthly_view_month_" + settings.id + "_" + month_id).length) { // Toggle Month toggleMonth(month_id); } else { if (!do_in_background) { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); } $.ajax({ url: settings.ajax_url, data: "action=mec_monthly_view_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigator_click, dataType: "json", type: "post", success: function (response) { // Append Month $("#mec_skin_events_" + settings.id).append('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-monthly-view-month-navigator-container").append('
' + response.navigator + '
'); // Append Events Side $("#mec_skin_" + settings.id + " .mec-calendar-events-side").append('
' + response.events_side + '
'); // Re-initialize Month Navigator initMonthNavigator(); // Set onclick Listeners setListeners(); if (!do_in_background) { // Toggle Month toggleMonth(response.current_month.id); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Set Month Filter values in search widget $("#mec_sf_month_" + settings.id).val(month); $("#mec_sf_year_" + settings.id).val(year); } else { $("#mec_monthly_view_month_" + settings.id + "_" + response.current_month.id).hide(); $("#mec_month_navigator_" + settings.id + "_" + response.current_month.id).hide(); $("#mec_month_side_" + settings.id + "_" + response.current_month.id).hide(); } if (typeof custom_month !== undefined) var custom_month; if (typeof custom_month != undefined) { if (custom_month == 'true') { $(".mec-month-container .mec-calendar-day").removeClass('mec-has-event'); $(".mec-month-container .mec-calendar-day").removeClass('mec-selected-day'); $('.mec-calendar-day').unbind('click'); } } }, error: function () {} }); } } function toggleMonth(month_id) { var active_month = $("#mec_skin_" + settings.id + " .mec-month-container-selected").data("month-id"); var active_day = $("#mec_monthly_view_month_" + settings.id + "_" + active_month + " .mec-selected-day").data("day"); if (active_day <= 9) active_day = "0" + active_day; // Toggle Month Navigator $("#mec_skin_" + settings.id + " .mec-month-navigator").hide(); $("#mec_month_navigator_" + settings.id + "_" + month_id).show(); // Toggle Month $("#mec_skin_" + settings.id + " .mec-month-container").hide(); $("#mec_monthly_view_month_" + settings.id + "_" + month_id).show(); // Add selected class $("#mec_skin_" + settings.id + " .mec-month-container").removeClass("mec-month-container-selected"); $("#mec_monthly_view_month_" + settings.id + "_" + month_id).addClass("mec-month-container-selected"); // Toggle Events Side $("#mec_skin_" + settings.id + " .mec-month-side").hide(); $("#mec_month_side_" + settings.id + "_" + month_id).show(); } var sf; function setListeners() { // Remove the onclick event $("#mec_skin_" + settings.id + " .mec-has-event").off("click"); // Add the onclick event $("#mec_skin_" + settings.id + " .mec-has-event").on('click', function (e) { e.preventDefault(); // define variables var $this = $(this), data_mec_cell = $this.data('mec-cell'), month_id = $this.data('month'); $("#mec_monthly_view_month_" + settings.id + "_" + month_id + " .mec-calendar-day").removeClass('mec-selected-day'); $this.addClass('mec-selected-day'); $('#mec_month_side_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec:not([data-mec-cell=' + data_mec_cell + '])').slideUp(); $('#mec_month_side_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec[data-mec-cell=' + data_mec_cell + ']').slideDown(); $('#mec_monthly_view_month_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec:not([data-mec-cell=' + data_mec_cell + '])').slideUp(); $('#mec_monthly_view_month_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec[data-mec-cell=' + data_mec_cell + ']').slideDown(); }); mec_tooltip(); // Single Event Method if (settings.sed_method != '0') { sed(); } if (settings.style == 'novel') { if ($('.mec-single-event-novel').length > 0) { $('.mec-single-event-novel').colourBrightness(); $('.mec-single-event-novel').each(function () { $(this).colourBrightness() }); } } } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-event-title a,#mec_skin_" + settings.id + " .event-single-link-novel,#mec_skin_" + settings.id + " .mec-monthly-tooltip").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } function mec_tooltip() { if ($('.mec-monthly-tooltip').length > 1) { if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) > 768) { $('.mec-monthly-tooltip').tooltipster({ theme: 'tooltipster-shadow', interactive: true, delay: 100, minWidth: 350, maxWidth: 350 }); if (settings.sed_method != '0') { sed(); } } else { var touchtime = 0; $(".mec-monthly-tooltip").on("click", function (event) { event.preventDefault(); if (touchtime == 0) { $('.mec-monthly-tooltip').tooltipster({ theme: 'tooltipster-shadow', interactive: true, delay: 100, minWidth: 350, maxWidth: 350, trigger: "custom", triggerOpen: { click: true, tap: true }, triggerClose: { click: true, tap: true } }); touchtime = new Date().getTime(); } else { if (((new Date().getTime()) - touchtime) < 200) { var el = $(this); var link = el.attr("href"); window.location = link; touchtime = 0; } else { touchtime = new Date().getTime(); } } }); } } } }; }(jQuery)); // MEC WEEKLY VIEW PLUGIN (function ($) { $.fn.mecWeeklyView = function (options) { var active_year; var active_month; var active_week; var active_week_number; // Default Options var settings = $.extend({ // These are the defaults. today: null, week: 1, id: 0, current_year: null, current_month: null, changeWeekElement: '.mec-load-week', month_navigator: 0, atts: '', ajax_url: '', sf: {} }, options); // Set Active Time active_year = settings.current_year; active_month = settings.current_month; // Search Widget if (settings.sf.container !== '') { $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(active_year, active_month, active_week); } }); } // Set The Week setThisWeek(settings.month_id + settings.week); // Set Listeners setListeners(); // Initialize Month Navigator if (settings.month_navigator) initMonthNavigator(settings.month_id); function setListeners() { $(settings.changeWeekElement).off('click').on('click', function (e) { var week = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('week-id'); var max_weeks = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('max-weeks'); var new_week_number = active_week_number; if ($(this).hasClass('mec-previous-month')) { week = parseInt(week) - 1; new_week_number--; } else { week = parseInt(week) + 1; new_week_number++; } if (new_week_number <= 1 || new_week_number >= max_weeks) { // Disable Next/Previous Button $(this).css({ 'opacity': .6, 'cursor': 'default' }); $(this).find('i').css({ 'opacity': .6, 'cursor': 'default' }); } else { // Enable Next/Previous Buttons $('#mec_skin_' + settings.id + ' .mec-load-week, #mec_skin_' + settings.id + ' .mec-load-week i').css({ 'opacity': 1, 'cursor': 'pointer' }); } // Week is not in valid range if (new_week_number === 0 || new_week_number > max_weeks) {} else { setThisWeek(week); } }); // Single Event Method if (settings.sed_method != '0') { sed(); } } function setThisWeek(week, auto_focus) { if (typeof auto_focus === 'undefined') auto_focus = false; // Week is not exists if (!$('#mec_weekly_view_week_' + settings.id + '_' + week).length) { return setThisWeek((parseInt(week) - 1)); } // Set week to active in week list $('#mec_skin_' + settings.id + ' .mec-weekly-view-week').removeClass('mec-weekly-view-week-active'); $('#mec_weekly_view_week_' + settings.id + '_' + week).addClass('mec-weekly-view-week-active'); $('#mec_weekly_view_top_week_' + settings.id + '_' + week).addClass('mec-weekly-view-week-active'); // Show related events $('#mec_skin_' + settings.id + ' .mec-weekly-view-date-events').addClass('mec-util-hidden'); $('.mec-weekly-view-week-' + settings.id + '-' + week).removeClass('mec-util-hidden'); $('#mec_skin_' + settings.id + ' .mec-calendar-row').addClass('mec-util-hidden'); $('#mec_skin_' + settings.id + ' .mec-calendar-row[data-week=' + week % 10 + ']').removeClass('mec-util-hidden'); active_week = week; active_week_number = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('week-number'); $('#mec_skin_' + settings.id + ' .mec-calendar-d-top').find('.mec-current-week').find('span').remove(); $('#mec_skin_' + settings.id + ' .mec-calendar-d-top').find('.mec-current-week').append('' + active_week_number + ''); if (active_week_number === 1) { // Disable Previous Button $('#mec_skin_' + settings.id + ' .mec-previous-month.mec-load-week').css({ 'opacity': .6, 'cursor': 'default' }); $('#mec_skin_' + settings.id + ' .mec-previous-month.mec-load-week').find('i').css({ 'opacity': .6, 'cursor': 'default' }); } // Go To Event Week if (auto_focus) mec_focus_week(settings.id); mecFluentCustomScrollbar(); } function initMonthNavigator(month_id) { $('#mec_month_navigator' + settings.id + '_' + month_id + ' .mec-load-month').off('click'); $('#mec_month_navigator' + settings.id + '_' + month_id + ' .mec-load-month').on('click', function () { var year = $(this).data('mec-year'); var month = $(this).data('mec-month'); setMonth(year, month, active_week, true); }); } function search(year, month, week, navigation_click) { var week_number = (String(week).slice(-1)); // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_weekly_view_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_week=" + week_number + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { // Remove Loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Append Month $("#mec_skin_events_" + settings.id).html('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-weekly-view-month-navigator-container").html('
' + response.navigator + '
'); // Set Listeners setListeners(); // Toggle Month toggleMonth(response.current_month.id); // Set active week setThisWeek(response.week_id, true); mecFluentCustomScrollbar(); }, error: function () {} }); } function setMonth(year, month, week, navigation_click) { var month_id = '' + year + month; var week_number = (String(week).slice(-1)); active_month = month; active_year = year; navigation_click = navigation_click || false; // Month exists so we just show it if ($("#mec_weekly_view_month_" + settings.id + "_" + month_id).length) { // Toggle Month toggleMonth(month_id); // Set active week setThisWeek('' + month_id + week_number); mecFluentCustomScrollbar(); } else { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_weekly_view_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_week=" + week_number + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigation_click, dataType: "json", type: "post", success: function (response) { // Remove Loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); $('#mec_skin_' + settings.id + ' .mec-calendar-d-top h3').after(response.topWeeks); // Append Month $("#mec_skin_events_" + settings.id).append('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-weekly-view-month-navigator-container").append('
' + response.navigator + '
'); // Set Listeners setListeners(); // Toggle Month toggleMonth(response.current_month.id); // Set active week setThisWeek(response.week_id, true); // Set Month Filter values in search widget $("#mec_sf_month_" + settings.id).val(month); $("#mec_sf_year_" + settings.id).val(year); mecFluentCustomScrollbar(); }, error: function () {} }); } } function toggleMonth(month_id) { // Show related events $('#mec_skin_' + settings.id + ' .mec-month-container').addClass('mec-util-hidden'); $('#mec_weekly_view_month_' + settings.id + '_' + month_id).removeClass('mec-util-hidden'); $('#mec_skin_' + settings.id + ' .mec-month-navigator').addClass('mec-util-hidden'); $('#mec_month_navigator' + settings.id + '_' + month_id).removeClass('mec-util-hidden'); // Initialize Month Navigator if (settings.month_navigator) initMonthNavigator(month_id); } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-event-title a").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } }; }(jQuery)); // MEC DAILY VIEW PLUGIN (function ($) { $.fn.mecDailyView = function (options) { var active_month; var active_year; var active_day; // Default Options var settings = $.extend({ // These are the defaults. today: null, id: 0, changeDayElement: '.mec-daily-view-day', events_label: 'Events', event_label: 'Event', month_navigator: 0, atts: '', ajax_url: '', sf: {}, }, options); active_month = settings.month; active_year = settings.year; active_day = settings.day; mecFluentCustomScrollbar(); // Set Today setToday(settings.today); // Set Listeners setListeners(); // Initialize Month Navigator if (settings.month_navigator) initMonthNavigator(settings.month_id); // Initialize Days Slider initDaysSlider(settings.month_id); // Slider first event day focus when page load. mecFocusDay(settings); // Search Widget if (settings.sf.container !== '') { $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(active_year, active_month, active_day); } }); } function setListeners() { $(settings.changeDayElement).on('click', function () { var today = $(this).data('day-id'); setToday(today); mecFluentCustomScrollbar(); }); // Single Event Method if (settings.sed_method != '0') { sed(); } } var current_monthday; function setToday(today) { // For caring about 31st, 30th and 29th of some months if (!$('#mec_daily_view_day' + settings.id + '_' + today).length) { setToday(parseInt(today) - 1); return false; } // Set day to active in day list $('.mec-daily-view-day').removeClass('mec-daily-view-day-active mec-color'); $('#mec_daily_view_day' + settings.id + '_' + today).addClass('mec-daily-view-day-active mec-color'); // Show related events $('.mec-daily-view-date-events').addClass('mec-util-hidden'); $('#mec_daily_view_date_events' + settings.id + '_' + today).removeClass('mec-util-hidden'); $('.mec-daily-view-events').addClass('mec-util-hidden'); $('#mec-daily-view-events' + settings.id + '_' + today).removeClass('mec-util-hidden'); // Set today label var weekday = $('#mec_daily_view_day' + settings.id + '_' + today).data('day-weekday'); var monthday = $('#mec_daily_view_day' + settings.id + '_' + today).data('day-monthday'); var count = $('#mec_daily_view_day' + settings.id + '_' + today).data('events-count'); var month_id = $('#mec_daily_view_day' + settings.id + '_' + today).data('month-id'); $('#mec_today_container' + settings.id + '_' + month_id).html('

' + monthday + '

' + weekday + '

' + count + ' ' + (count > 1 ? settings.events_label : settings.event_label) + '
'); if (monthday <= 9) current_monthday = '0' + monthday; else current_monthday = monthday; } function initMonthNavigator(month_id) { $('#mec_month_navigator' + settings.id + '_' + month_id + ' .mec-load-month').off('click'); $('#mec_month_navigator' + settings.id + '_' + month_id + ' .mec-load-month').on('click', function () { var year = $(this).data('mec-year'); var month = $(this).data('mec-month'); setMonth(year, month, current_monthday, true); }); } function initDaysSlider(month_id, day_id) { // Set Global Month Id mec_g_month_id = month_id; // Check RTL website var owl_rtl = $('body').hasClass('rtl') ? true : false; // Init Days slider var owl = $("#mec-owl-calendar-d-table-" + settings.id + "-" + month_id); owl.owlCarousel({ responsiveClass: true, responsive: { 0: { items: owl.closest('.mec-fluent-wrap').length > 0 ? 3 : 2, }, 479: { items: 4, }, 767: { items: 7, }, 960: { items: 14, }, 1000: { items: 19, }, 1200: { items: 22, } }, dots: false, loop: false, rtl: owl_rtl, }); // Custom Navigation Events $("#mec_daily_view_month_" + settings.id + "_" + month_id + " .mec-table-d-next").click(function (e) { e.preventDefault(); owl.trigger('next.owl.carousel'); }); $("#mec_daily_view_month_" + settings.id + "_" + month_id + " .mec-table-d-prev").click(function (e) { e.preventDefault(); owl.trigger('prev.owl.carousel'); }); if (typeof day_id === 'undefined') day_id = $('.mec-daily-view-day-active').data('day-id'); var today_str = day_id.toString().substring(6, 8); var today_int = parseInt(today_str); owl.trigger('owl.goTo', [today_int]); } function search(year, month, day) { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_daily_view_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_day=" + day + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { // Remove Loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Append Month $("#mec_skin_events_" + settings.id).html('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-calendar-a-month.mec-clear").html('
' + response.navigator + '
'); // Set Listeners setListeners(); active_year = response.current_month.year; active_month = response.current_month.month; // Toggle Month toggleMonth(response.current_month.id, '' + active_year + active_month + active_day); // Set Today setToday('' + active_year + active_month + active_day); // Focus First Active Day mecFocusDay(settings); mecFluentCustomScrollbar(); }, error: function () {} }); } function setMonth(year, month, day, navigation_click) { var month_id = '' + year + month; active_month = month; active_year = year; active_day = day; navigation_click = navigation_click || false; // Month exists so we just show it if ($("#mec_daily_view_month_" + settings.id + "_" + month_id).length) { // Toggle Month toggleMonth(month_id); // Set Today setToday('' + month_id + day); } else { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_daily_view_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_day=" + day + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigation_click, dataType: "json", type: "post", success: function (response) { // Remove Loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Append Month $("#mec_skin_events_" + settings.id).append('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-calendar-a-month.mec-clear").append('
' + response.navigator + '
'); // Set Listeners setListeners(); // Toggle Month toggleMonth(response.current_month.id, '' + year + month + '01'); // Set Today setToday('' + year + month + '01'); // Set Month Filter values in search widget $("#mec_sf_month_" + settings.id).val(month); $("#mec_sf_year_" + settings.id).val(year); mecFluentCustomScrollbar(); }, error: function () {} }); } } function toggleMonth(month_id, day_id) { // Show related events $('#mec_skin_' + settings.id + ' .mec-month-container').addClass('mec-util-hidden'); $('#mec_daily_view_month_' + settings.id + '_' + month_id).removeClass('mec-util-hidden'); $('#mec_skin_' + settings.id + ' .mec-month-navigator').addClass('mec-util-hidden'); $('#mec_month_navigator' + settings.id + '_' + month_id).removeClass('mec-util-hidden'); // Initialize Month Navigator if (settings.month_navigator) initMonthNavigator(month_id); // Initialize Days Slider initDaysSlider(month_id, day_id); // Focus First Active Day mecFocusDay(settings); } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-event-title a").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } }; }(jQuery)); // MEC TIMETABLE PLUGIN (function ($) { $.fn.mecTimeTable = function (options) { var active_year; var active_month; var active_week; var active_week_number; var active_day; // Default Options var settings = $.extend({ // These are the defaults. today: null, week: 1, active_day: 1, id: 0, changeWeekElement: '.mec-load-week', month_navigator: 0, atts: '', ajax_url: '', sf: {} }, options); // Search Widget if (settings.sf.container !== '') { $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(active_year, active_month, active_week, active_day); } }); } // Set The Week setThisWeek(settings.month_id + settings.week, settings.active_day); // Set Listeners setListeners(); // Initialize Month Navigator if (settings.month_navigator) initMonthNavigator(settings.month_id); function setListeners() { // Change Week Listener $(settings.changeWeekElement).off('click').on('click', function () { var week = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('week-id'); var max_weeks = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('max-weeks'); var new_week_number = active_week_number; if ($(this).hasClass('mec-previous-month')) { week = parseInt(week) - 1; new_week_number--; } else { week = parseInt(week) + 1; new_week_number++; } if (new_week_number <= 1 || new_week_number >= max_weeks) { // Disable Next/Previous Button $(this).css({ 'opacity': .6, 'cursor': 'default' }); $(this).find('i').css({ 'opacity': .6, 'cursor': 'default' }); } else { // Enable Next/Previous Buttons $('#mec_skin_' + settings.id + ' .mec-load-week, #mec_skin_' + settings.id + ' .mec-load-week i').css({ 'opacity': 1, 'cursor': 'pointer' }); } // Week is not in valid range if (new_week_number === 0 || new_week_number > max_weeks) {} else { setThisWeek(week); } }); // Change Day Listener $('#mec_skin_' + settings.id + ' .mec-weekly-view-week dt').not('.mec-timetable-has-no-event').off('click').on('click', function () { var day = $(this).data('date-id'); setDay(day); }); // Single Event Method if (settings.sed_method != '0') { sed(); } } function setThisWeek(week, day) { // Week is not exists if (!$('#mec_weekly_view_week_' + settings.id + '_' + week).length) { return setThisWeek((parseInt(week) - 1), day); } // Set week to active in week list $('#mec_skin_' + settings.id + ' .mec-weekly-view-week').removeClass('mec-weekly-view-week-active'); $('#mec_weekly_view_week_' + settings.id + '_' + week).addClass('mec-weekly-view-week-active'); setDay(day); active_week = week; active_week_number = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active').data('week-number'); $('#mec_skin_' + settings.id + ' .mec-calendar-d-top').find('.mec-current-week').find('span').remove(); $('#mec_skin_' + settings.id + ' .mec-calendar-d-top').find('.mec-current-week').append('' + active_week_number + ''); if (active_week_number === 1) { // Disable Previous Button $('#mec_skin_' + settings.id + ' .mec-previous-month.mec-load-week').css({ 'opacity': .6, 'cursor': 'default' }); $('#mec_skin_' + settings.id + ' .mec-previous-month.mec-load-week').find('i').css({ 'opacity': .6, 'cursor': 'default' }); } } function setDay(day) { // Find the date automatically if (typeof day === 'undefined') { day = $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active dt').not('.mec-timetable-has-no-event').first().data('date-id'); } // Activate the date element $('#mec_skin_' + settings.id + ' dt').removeClass('mec-timetable-day-active'); $('#mec_skin_' + settings.id + ' .mec-weekly-view-week-active dt[data-date-id="' + day + '"]').addClass('mec-timetable-day-active'); // Show related events $('#mec_skin_' + settings.id + ' .mec-weekly-view-date-events').addClass('mec-util-hidden'); $('.mec_weekly_view_date_events' + settings.id + '_' + day).removeClass('mec-util-hidden').show(); } function initMonthNavigator(month_id) { $('#mec_month_navigator' + settings.id + '_' + month_id + ' .mec-load-month').off('click').on('click', function () { var year = $(this).data('mec-year'); var month = $(this).data('mec-month'); setMonth(year, month, active_week); }); } function search(year, month, week) { var week_number = (String(week).slice(-1)); // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); // Set MEC Year And Month If Undefined year = typeof year == 'undefined' ? '' : year; month = typeof month == 'undefined' ? '' : month; // Append current week to data body for used after filter. $('body').data('currentweek', $("#mec_skin_events_" + settings.id).find('.mec-current-week > span').html()); $.ajax({ url: settings.ajax_url, data: "action=mec_timetable_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_week=" + week_number + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { // Remove Loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Append Month $("#mec_skin_events_" + settings.id).html('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-weekly-view-month-navigator-container").html('
' + response.navigator + '
'); // Set Listeners setListeners(); // Toggle Month toggleMonth(response.current_month.id); // Set active week setThisWeek(response.week_id); // Focus First Active Week mec_focus_week(settings.id, 'timetable'); mecFluentCustomScrollbar(); }, error: function () {} }); } function setMonth(year, month, week) { var month_id = '' + year + month; var week_number = (String(week).slice(-1)); active_month = month; active_year = year; // Month exists so we just show it if ($("#mec_timetable_month_" + settings.id + "_" + month_id).length) { // Toggle Month toggleMonth(month_id); // Set active week setThisWeek('' + month_id + week_number); } else { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_timetable_load_month&mec_year=" + year + "&mec_month=" + month + "&mec_week=" + week_number + "&" + settings.atts + "&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { // Remove Loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Append Month $("#mec_skin_events_" + settings.id).append('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-weekly-view-month-navigator-container").append('
' + response.navigator + '
'); // Set Listeners setListeners(); // Toggle Month toggleMonth(response.current_month.id); // Set active week setThisWeek(response.week_id); // Set Month Filter values in search widget $("#mec_sf_month_" + settings.id).val(month); $("#mec_sf_year_" + settings.id).val(year); }, error: function () {} }); } } function toggleMonth(month_id) { // Show related events $('#mec_skin_' + settings.id + ' .mec-month-container').addClass('mec-util-hidden'); $('#mec_timetable_month_' + settings.id + '_' + month_id).removeClass('mec-util-hidden'); $('#mec_skin_' + settings.id + ' .mec-month-navigator').addClass('mec-util-hidden'); $('#mec_month_navigator' + settings.id + '_' + month_id).removeClass('mec-util-hidden'); // Initialize Month Navigator if (settings.month_navigator) initMonthNavigator(month_id); } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-timetable-event-title a").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } }; }(jQuery)); // MEC WEEKLY PROGRAM PLUGIN (function ($) { $.fn.mecWeeklyProgram = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', sf: {} }, options); // Search Widget if (settings.sf.container !== '') { $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(); } }); } // Set Listeners setListeners(); function setListeners() { // Single Event Method if (settings.sed_method != '0') { sed(); } } function search() { var $modal = $('.mec-modal-result'); // Add Loading Class if ($modal.length === 0) $('.mec-wrap').append('
'); $modal.addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_weeklyprogram_load&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { // Remove Loading Class $modal.removeClass("mec-month-navigator-loading"); // Append Month $("#mec_skin_events_" + settings.id).html(response.date_events); // Set Listeners setListeners(); }, error: function () {} }); } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-event-title a").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } }; }(jQuery)); // MEC MASONRY VIEW PLUGIN (function ($) { $.fn.mecMasonryView = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', ajax_url: '', sf: {}, end_date: '', offset: 0, start_date: '', }, options); // Set onclick Listeners setListeners(); // Init Masonry jQuery(window).load(function () { initMasonry(); if (typeof custom_dev !== undefined) var custom_dev; if (custom_dev == 'yes') { $(".mec-wrap").css("height", "1550"); if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 768) { $(".mec-wrap").css("height", "5500"); } if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 480) { $(".mec-wrap").css("height", "5000"); } $(".mec-event-masonry .mec-masonry-item-wrap:nth-child(n+20)").css("display", "none"); $(".mec-load-more-button").on("click", function () { $(".mec-event-masonry .mec-masonry-item-wrap:nth-child(n+20)").css("display", "block"); $(".mec-wrap").css("height", "auto"); initMasonry(); $(".mec-load-more-button").hide(); }) $(".mec-events-masonry-cats a:first-child").on("click", function () { $(".mec-wrap").css("height", "auto"); $(".mec-event-masonry .mec-masonry-item-wrap:nth-child(n+20)").css("display", "block"); $(".mec-load-more-button").hide(); initMasonry(); }) $(".mec-events-masonry-cats a:not(:first-child)").on("click", function () { $(".mec-load-more-button").hide(); $(".mec-wrap").css("height", "auto"); $(".mec-wrap").css("min-height", "400"); $(".mec-event-masonry .mec-masonry-item-wrap").css("display", "block"); var element = document.querySelector("#mec_skin_" + settings.id + " .mec-event-masonry"); var selector = $(this).attr('data-group'); var CustomShuffle = new Shuffle(element, { itemSelector: '.mec-masonry-item-wrap', }); CustomShuffle.sort({ by: element.getAttribute('data-created'), }); CustomShuffle.filter(selector != '*' ? selector : Shuffle.ALL_ITEMS); $(".mec-event-masonry .mec-masonry-item-wrap").css("visibility", "visible"); }) } }); // Fix Elementor Masonry if ( mecdata.elementor_edit_mode != 'no' ) elementorFrontend.hooks.addAction('frontend/element_ready/global', initMasonry()); function initMasonry() { var $container = $("#mec_skin_" + settings.id + " .mec-event-masonry"); var data_sortAscending = $("#mec_skin_" + settings.id).data('sortascending'); var $grid = $container.isotope({ filter: '*', itemSelector: '.mec-masonry-item-wrap', getSortData: { date: '[data-sort-masonry]', }, sortBy: 'date', sortAscending: data_sortAscending, animationOptions: { duration: 750, easing: 'linear', queue: false }, }); if (settings.fit_to_row == 1) $grid.isotope({ layoutMode: 'fitRows', sortAscending: data_sortAscending, }); // Fix Elementor tab $('.elementor-tabs').find('.elementor-tab-title').click(function () { $grid.isotope({ sortBy: 'date', sortAscending: data_sortAscending, }); }); $("#mec_skin_" + settings.id + " .mec-events-masonry-cats a").click(function () { var selector = $(this).attr('data-filter'); var $grid_cat = $container.isotope({ filter: selector, itemSelector: '.mec-masonry-item-wrap', getSortData: { date: '[data-sort-masonry]', }, sortBy: 'date', sortAscending: data_sortAscending, animationOptions: { duration: 750, easing: 'linear', queue: false }, }); if (settings.masonry_like_grid == 1) $grid_cat.isotope({ sortBy: 'date', sortAscending: data_sortAscending, }); return false; }); var $optionSets = $("#mec_skin_" + settings.id + " .mec-events-masonry-cats"), $optionLinks = $optionSets.find('a'); $optionLinks.click(function () { var $this = $(this); // don't proceed if already selected if ($this.hasClass('selected')) return false; var $optionSet = $this.parents('.mec-events-masonry-cats'); $optionSet.find('.mec-masonry-cat-selected').removeClass('mec-masonry-cat-selected'); $this.addClass('mec-masonry-cat-selected'); }); } function setListeners() { if (settings.sed_method != '0') { sed(); } } $("#mec_skin_" + settings.id + " .mec-events-masonry-cats > a").click(function() { var mec_load_more_btn = $("#mec_skin_" + settings.id + " .mec-load-more-button"); var mec_filter_value = $(this).data('filter').replace('.mec-t', ''); if(mec_load_more_btn.hasClass('mec-load-more-loading')) mec_load_more_btn.removeClass('mec-load-more-loading'); if(mec_load_more_btn.hasClass("mec-hidden-" + mec_filter_value)) mec_load_more_btn.addClass("mec-util-hidden"); else mec_load_more_btn.removeClass("mec-util-hidden"); }); $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () { loadMore(); }); function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-masonry-img a, #mec_skin_" + settings.id + " .mec-event-title a, #mec_skin_" + settings.id + " .mec-booking-button").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } function loadMore() { // Add loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading"); var mec_cat_elem = $('#mec_skin_' + settings.id).find('.mec-masonry-cat-selected'); var mec_filter_value = (mec_cat_elem && mec_cat_elem.data('filter') != undefined) ? mec_cat_elem.data('filter').replace('.mec-t', '') : ''; var mec_filter_by = $('#mec_skin_' + settings.id).data('filterby'); $.ajax({ url: settings.ajax_url, data: "action=mec_masonry_load_more&mec_filter_by=" + mec_filter_by + "&mec_filter_value=" + mec_filter_value + "&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Hide load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden mec-hidden-" + mec_filter_value); } else { // Show load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Append Items var node = $("#mec_skin_" + settings.id + " .mec-event-masonry"); var markup = '', newItems = $(response.html).find('.mec-masonry-item-wrap'); newItems.each(function (index) { node.isotope() .append(newItems[index]) .isotope('appended', newItems[index]); }); // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; // Single Event Method if (settings.sed_method != '0') { sed(); } } }, error: function () {} }); } }; }(jQuery)); // MEC LIST VIEW PLUGIN (function ($) { $.fn.mecListView = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', ajax_url: '', sf: {}, current_month_divider: '', end_date: '', offset: 0, limit: 0 }, options); // Set onclick Listeners setListeners(); var sf; function setListeners() { // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(); } }); } $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () { loadMore(); }); // Accordion Toggle if (settings.style === 'accordion') { if (settings.toggle_month_divider) { $('#mec_skin_' + settings.id + ' .mec-month-divider:first-of-type').addClass('active'); $('#mec_skin_' + settings.id + ' .mec-month-divider:first-of-type').find('i').removeClass('mec-sl-arrow-down').addClass('mec-sl-arrow-up'); toggle(); } accordion(); } // Single Event Method if (settings.sed_method != '0') { sed(); } } function toggle() { $('#mec_skin_' + settings.id + ' .mec-month-divider').off("click").on("click", function (event) { event.preventDefault(); var status = $(this).hasClass('active'); // Remove Active Style of Month Divider $('#mec_skin_' + settings.id + ' .mec-month-divider').removeClass('active'); // Hide All Events $('#mec_skin_' + settings.id + ' .mec-divider-toggle').slideUp('fast'); if (status) { $(this).removeClass('active'); $('.mec-month-divider').find('i').removeClass('mec-sl-arrow-up').addClass('mec-sl-arrow-down'); } else { $(this).addClass('active'); $('.mec-month-divider').find('i').removeClass('mec-sl-arrow-up').addClass('mec-sl-arrow-down') $(this).find('i').removeClass('mec-sl-arrow-down').addClass('mec-sl-arrow-up'); var month = $(this).data('toggle-divider'); $('#mec_skin_' + settings.id + ' .' + month).slideDown('fast'); } }); } function toggleLoadmore() { $('#mec_skin_' + settings.id + ' .mec-month-divider:not(:last)').each(function () { if($(this).hasClass('active')) $(this).removeClass('active'); var month = $(this).data('toggle-divider'); $('#mec_skin_' + settings.id + ' .' + month).slideUp('fast'); }); // Set Active Class For Last Article $('#mec_skin_' + settings.id + ' .mec-month-divider:last').addClass('active'); // Register Listeners toggle(); } function accordion() { // Accordion Toggle $("#mec_skin_" + settings.id + " .mec-toggle-item-inner").off("click").on("click", function (event) { event.preventDefault(); var $this = $(this); $(this).parent().find(".mec-content-toggle").slideToggle("fast", function () { $this.children("i").toggleClass("mec-sl-arrow-down mec-sl-arrow-up"); }); // Trigger Google Map var unique_id = $(this).parent().find(".mec-modal-wrap").data('unique-id'); window['mec_init_gmap' + unique_id](); }); } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-event-title a, #mec_skin_" + settings.id + " .mec-booking-button, #mec_skin_" + settings.id + " .mec-detail-button").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); $("#mec_skin_" + settings.id + " .mec-event-image a img").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).parent().attr('href'); var id = $(this).parent().data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } function loadMore() { // Add loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading"); $.ajax({ url: settings.ajax_url, data: "action=mec_list_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "¤t_month_divider=" + settings.current_month_divider + "&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { if (response.count == '0') { // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Hide load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); } else { // Show load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Append Items $("#mec_skin_events_" + settings.id).append(response.html); // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; settings.current_month_divider = response.current_month_divider; // Single Event Method if (settings.sed_method != '0') { sed(); } // Accordion Toggle if (settings.style === 'accordion') { if (settings.toggle_month_divider) toggleLoadmore(); accordion(); } } }, error: function () {} }); } function search() { // Hide no event message $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden"); // Add loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); jQuery("#gmap-data").val(""); $.ajax({ url: settings.ajax_url, data: "action=mec_list_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "¤t_month_divider=0&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Append Items $("#mec_skin_events_" + settings.id).html(''); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Hide Map $('.mec-skin-map-container').addClass("mec-util-hidden"); // Hide it $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Show no event message $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden"); } else { // Append Items $("#mec_skin_events_" + settings.id).html(response.html); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Show Map $('.mec-skin-map-container').removeClass("mec-util-hidden"); // Show load more button if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Hide load more button else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; settings.current_month_divider = response.current_month_divider; // Single Event Method if (settings.sed_method != '0') { sed(); } // Accordion Toggle if (settings.style === 'accordion') { if (settings.toggle_month_divider) toggle(); accordion(); } } }, error: function () {} }); } }; }(jQuery)); // MEC GRID VIEW PLUGIN (function ($) { $.fn.mecGridView = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', ajax_url: '', sf: {}, end_date: '', offset: 0, start_date: '', }, options); // Set onclick Listeners setListeners(); var sf; function setListeners() { // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(); } }); } $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () { loadMore(); }); // Single Event Method if (settings.sed_method != '0') { sed(); } } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-event-title a, #mec_skin_" + settings.id + " .mec-booking-button").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); $("#mec_skin_" + settings.id + " .mec-event-image a img").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).parent().attr('href'); var id = $(this).parent().data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } function loadMore() { // Add loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading"); $.ajax({ url: settings.ajax_url, data: "action=mec_grid_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Hide load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); } else { // Show load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Append Items $("#mec_skin_events_" + settings.id).append(response.html); // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; // Single Event Method if (settings.sed_method != '0') { sed(); } } }, error: function () {} }); } function search() { // Hide no event message $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden"); // Add loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); jQuery("#gmap-data").val(""); $.ajax({ url: settings.ajax_url, data: "action=mec_grid_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Append Items $("#mec_skin_events_" + settings.id).html(''); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Hide Map $('.mec-skin-map-container').addClass("mec-util-hidden"); // Hide it $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Show no event message $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden"); } else { // Append Items $("#mec_skin_events_" + settings.id).html(response.html); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Show Map $('.mec-skin-map-container').removeClass("mec-util-hidden"); // Show load more button if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Hide load more button else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; // Single Event Method if (settings.sed_method != '0') { sed(); } } }, error: function () {} }); } }; }(jQuery)); // MEC CUSTOM VIEW PLUGIN (function ($) { $.fn.mecCustomView = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', ajax_url: '', sf: {}, end_date: '', offset: 0, start_date: '', }, options); // Set onclick Listeners setListeners(); var sf; function setListeners() { // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(); } }); } $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () { loadMore(); }); // Single Event Method if (settings.sed_method != '0') { sed(); } } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-event-title a, #mec_skin_" + settings.id + " .mec-booking-button").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); $("#mec_skin_" + settings.id + " .mec-event-image a img").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).parent().attr('href'); var id = $(this).parent().data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } function loadMore() { // Add loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading"); $.ajax({ url: settings.ajax_url, data: "action=mec_custom_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Hide load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); } else { // Show load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Append Items $("#mec_skin_events_" + settings.id).append(response.html); // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; if ( $('.mec-event-sd-countdown').length > 0 ) { $('.mec-event-sd-countdown').each(function (event) { var dc= $(this).attr('data-date-custom'); $(this).mecCountDown( { date: dc, format: "off" }, function () { }); }) } // Single Event Method if (settings.sed_method != '0') { sed(); } } }, error: function () {} }); } function search() { // Hide no event message $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden"); // Add loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); jQuery("#gmap-data").val(""); $.ajax({ url: settings.ajax_url, data: "action=mec_custom_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Append Items $("#mec_skin_events_" + settings.id).html(''); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Hide Map $('.mec-skin-map-container').addClass("mec-util-hidden"); // Hide it $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Show no event message $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden"); } else { // Append Items $("#mec_skin_events_" + settings.id).html(response.html); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Show Map $('.mec-skin-map-container').removeClass("mec-util-hidden"); // Show load more button if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Hide load more button else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; // Single Event Method if (settings.sed_method != '0') { sed(); } } }, error: function () {} }); } }; }(jQuery)); // MEC TIMELINE VIEW PLUGIN (function ($) { $.fn.mecTimelineView = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', ajax_url: '', sf: {}, end_date: '', offset: 0, start_date: '', }, options); // Set onclick Listeners setListeners(); var sf; function setListeners() { // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(); } }); } $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () { loadMore(); }); // Single Event Method if (settings.sed_method != '0') { sed(); } } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-timeline-event-image a, #mec_skin_" + settings.id + " .mec-event-title a, #mec_skin_" + settings.id + " .mec-booking-button").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); $("#mec_skin_" + settings.id + " .mec-event-image a img").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).parent().attr('href'); var id = $(this).parent().data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } function loadMore() { // Add loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading"); $.ajax({ url: settings.ajax_url, data: "action=mec_timeline_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Hide load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); } else { // Show load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Append Items $("#mec_skin_events_" + settings.id).append(response.html); // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; // Single Event Method if (settings.sed_method != '0') { sed(); } } }, error: function () { } }); } function search() { // Hide no event message $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden"); // Add loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax({ url: settings.ajax_url, data: "action=mec_timeline_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Append Items $("#mec_skin_events_" + settings.id).html(''); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Hide Map $('.mec-skin-map-container').addClass("mec-util-hidden"); // Hide it $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Show no event message $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden"); } else { // Append Items $("#mec_skin_events_" + settings.id).html(response.html); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Show Map $('.mec-skin-map-container').removeClass("mec-util-hidden"); // Show load more button if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Hide load more button else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; // Single Event Method if (settings.sed_method != '0') { sed(); } } }, error: function () { } }); } }; }(jQuery)); // MEC AGENDA VIEW PLUGIN (function ($) { $.fn.mecAgendaView = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', ajax_url: '', sf: {}, current_month_divider: '', end_date: '', offset: 0, }, options); // Set onclick Listeners setListeners(); var sf; function setListeners() { // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(); } }); } $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () { loadMore(); }); // Single Event Method if (settings.sed_method != '0') { sed(); } } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-agenda-event-title a").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } function loadMore() { // Add loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading"); $.ajax({ url: settings.ajax_url, data: "action=mec_agenda_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "¤t_month_divider=" + settings.current_month_divider + "&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Hide load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); } else { // Show load more button $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Append Items $("#mec_skin_events_" + settings.id + " .mec-events-agenda-container").append(response.html); // Remove loading Class $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; settings.current_month_divider = response.current_month_divider; // Single Event Method if (settings.sed_method != '0') { sed(); } mecFluentCustomScrollbar(); } }, error: function () {} }); } function search() { // Hide no event message $("#mec_skin_no_events_" + settings.id).addClass("mec-util-hidden"); // Add loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); mecFluentCustomScrollbar(); $.ajax({ url: settings.ajax_url, data: "action=mec_agenda_load_more&mec_start_date=" + settings.start_date + "&" + settings.atts + "¤t_month_divider=0&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { if (response.count == "0") { // Append Items $("#mec_skin_events_" + settings.id + " .mec-events-agenda-container").html(''); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Hide it $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Show no event message $("#mec_skin_no_events_" + settings.id).removeClass("mec-util-hidden"); } else { // Append Items $("#mec_skin_events_" + settings.id + " .mec-events-agenda-container").html(response.html); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Show load more button if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Hide load more button else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; settings.current_month_divider = response.current_month_divider; // Single Event Method if (settings.sed_method != '0') { sed(); } } mecFluentCustomScrollbar(); }, error: function () {} }); } }; }(jQuery)); // MEC CAROUSEL VIEW PLUGIN (function ($) { $.fn.mecCarouselView = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', ajax_url: '', sf: {}, items: 3, autoplay: '', style: 'type1', start_date: '' }, options); // Init Sliders initSlider(settings); // Single Event Method if (settings.sed_method != '0') { sed(settings); } function initSlider(settings) { // Check RTL website if ($('body').hasClass('rtl')) { var owl_rtl = true; } else { var owl_rtl = false; } if (settings.style === 'type1') { // Start carousel skin var owl = $("#mec_skin_" + settings.id + " .mec-event-carousel-type1 .mec-owl-carousel"); owl.owlCarousel({ autoplay: true, autoplayTimeout: settings.autoplay, // Set AutoPlay to 3 seconds loop: true, items: settings.items, responsiveClass: true, responsive: { 0: { items: 1, }, 979: { items: 2, }, 1199: { items: settings.count, } }, dots: true, nav: false, autoplayHoverPause: true, rtl: owl_rtl, }); owl.bind( "mouseleave", function (event) { $("#mec_skin_" + settings.id + " .mec-owl-carousel").trigger('play.owl.autoplay'); } ); } else if (settings.style === 'type4') { $("#mec_skin_" + settings.id + " .mec-owl-carousel").owlCarousel({ autoplay: true, loop: true, autoplayTimeout: settings.autoplay, items: settings.items, dots: false, nav: true, responsiveClass: true, responsive: { 0: { items: 1, stagePadding: 50, }, 979: { items: 2, }, 1199: { items: settings.count, } }, autoplayHoverPause: true, navText: ["", " "], rtl: owl_rtl, }); $("#mec_skin_" + settings.id + " .mec-owl-carousel").bind( "mouseleave", function (event) { $("#mec_skin_" + settings.id + " .mec-owl-carousel").trigger('play.owl.autoplay'); } ); } else { $("#mec_skin_" + settings.id + " .mec-owl-carousel").owlCarousel({ autoplay: true, loop: true, autoplayTimeout: settings.autoplay, items: settings.items, dots: typeof settings.dots_navigation != 'undefined' ? settings.dots_navigation : false, nav: typeof settings.navigation != 'undefined' ? settings.navigation : true, responsiveClass: true, responsive: { 0: { items: 1, }, 979: { items: 2, }, 1199: { items: settings.count, } }, autoplayHoverPause: true, navText: typeof settings.navText != 'undefined' ? settings.navText : ["", " "], rtl: owl_rtl, }); $("#mec_skin_" + settings.id + " .mec-owl-carousel").bind( "mouseleave", function (event) { $("#mec_skin_" + settings.id + " .mec-owl-carousel").trigger('play.owl.autoplay'); } ); } } }; function sed(settings) { // Single Event Display $("#mec_skin_" + settings.id + " .mec-event-carousel-title a, #mec_skin_" + settings.id + " .mec-booking-button, #mec_skin_" + settings.id + " .mec-event-button").off('click').on('click', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } }(jQuery)); // MEC SLIDER VIEW PLUGIN (function ($) { $.fn.mecSliderView = function (options) { // Default Options var settings = $.extend({ // These are the defaults. id: 0, atts: '', autoplay: false, ajax_url: '', sf: {}, start_date: '' }, options); // Init Sliders initSlider(); function initSlider() { // Check RTL website if ($('body').hasClass('rtl')) { var owl_rtl = true; } else { var owl_rtl = false; } $("#mec_skin_" + settings.id + " .mec-owl-carousel").owlCarousel({ autoplay: true, autoplayTimeout: settings.autoplay, loop: true, items: 1, responsiveClass: true, responsive: { 0: { items: 1, }, 960: { items: 1, }, 1200: { items: 1, } }, dots: false, nav: true, autoplayHoverPause: true, navText: typeof settings.navText != 'undefined' ? settings.navText : ["", " "], rtl: owl_rtl, }); } }; }(jQuery)); // MEC COUNTDOWN MODULE (function ($) { $.fn.mecCountDown = function (options, callBack) { // Default Options var settings = $.extend({ // These are the defaults. date: null, format: null }, options); var callback = callBack; var selector = $(this); startCountdown(); var interval = setInterval(startCountdown, 1000); function startCountdown() { var eventDate = Date.parse(settings.date) / 1000; var currentDate = Math.floor($.now() / 1000); if (eventDate <= currentDate) { callback.call(this); clearInterval(interval); } var seconds = eventDate - currentDate; var days = Math.floor(seconds / (60 * 60 * 24)); seconds -= days * 60 * 60 * 24; var hours = Math.floor(seconds / (60 * 60)); seconds -= hours * 60 * 60; var minutes = Math.floor(seconds / 60); seconds -= minutes * 60; if (days == 1) selector.find(".mec-timeRefDays").text(mecdata.day); else selector.find(".mec-timeRefDays").text(mecdata.days); if (hours == 1) selector.find(".mec-timeRefHours").text(mecdata.hour); else selector.find(".mec-timeRefHours").text(mecdata.hours); if (minutes == 1) selector.find(".mec-timeRefMinutes").text(mecdata.minute); else selector.find(".mec-timeRefMinutes").text(mecdata.minutes); if (seconds == 1) selector.find(".mec-timeRefSeconds").text(mecdata.second); else selector.find(".mec-timeRefSeconds").text(mecdata.seconds); if (settings.format === "on") { days = (String(days).length >= 2) ? days : "0" + days; hours = (String(hours).length >= 2) ? hours : "0" + hours; minutes = (String(minutes).length >= 2) ? minutes : "0" + minutes; seconds = (String(seconds).length >= 2) ? seconds : "0" + seconds; } if (!isNaN(eventDate)) { selector.find(".mec-days").text(days); selector.find(".mec-hours").text(hours); selector.find(".mec-minutes").text(minutes); selector.find(".mec-seconds").text(seconds); } else { clearInterval(interval); } } }; }(jQuery)); // MEC TILE VIEW PLUGIN (function($) { $.fn.mecTileView = function(options) { var active_month; var active_year; // Default Options var settings = $.extend({ // These are the defaults. today: null, id: 0, events_label: 'Events', event_label: 'Event', month_navigator: 0, atts: '', active_month: {}, next_month: {}, sf: {}, ajax_url: '' }, options); // Initialize Month Navigator if(settings.month_navigator) initMonthNavigator(); // Load Next Month in background if(settings.load_method === 'month') setMonth(settings.next_month.year, settings.next_month.month, true); active_month = settings.active_month.month; active_year = settings.active_month.year; // Set onclick Listeners setListeners(); // Search Widget if(settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm( { id: settings.id, atts: settings.atts, callback: function(atts) { settings.atts = atts; search(active_year, active_month); } }); } function initMonthNavigator() { $("#mec_skin_" + settings.id + " .mec-load-month").off("click").on("click", function() { var year = $(this).data("mec-year"); var month = $(this).data("mec-month"); setMonth(year, month, false, true); }); } function search(year, month) { // Add Loading Class if(jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); $.ajax( { url: settings.ajax_url, data: "action=mec_tile_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function(response) { if(settings.load_method === 'month') { active_month = response.current_month.month; active_year = response.current_month.year; // Append Month $("#mec_skin_events_" + settings.id).html('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-tile-month-navigator-container").append('
' + response.navigator + '
'); // Re-initialize Month Navigator initMonthNavigator(); // Set onclick Listeners setListeners(); // Toggle Month toggleMonth(response.current_month.id); } else { // Append Items $("#mec_skin_events_" + settings.id).html(response.html); // Show load more button if (response.count >= settings.limit) $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); // Hide load more button else $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; // Set onclick Listeners setListeners(); } // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); }, error: function(){} }); } function setMonth(year, month, do_in_background, navigator_click) { if(typeof do_in_background === "undefined") do_in_background = false; navigator_click = navigator_click || false; var month_id = year + "" + month; if(!do_in_background) { active_month = month; active_year = year; } // Month exists so we just show it if($("#mec_tile_month_" + settings.id + "_" + month_id).length) { // Toggle Month toggleMonth(month_id); } else { if(!do_in_background) { // Add Loading Class if(jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); } $.ajax( { url: settings.ajax_url, data: "action=mec_tile_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigator_click, dataType: "json", type: "post", success: function(response) { // Append Month $("#mec_skin_events_" + settings.id).append('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-tile-month-navigator-container").append('
' + response.navigator + '
'); // Re-initialize Month Navigator initMonthNavigator(); // Set onclick Listeners setListeners(); if(!do_in_background) { // Toggle Month toggleMonth(response.current_month.id); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Set Month Filter values in search widget $("#mec_sf_month_" + settings.id).val(month); $("#mec_sf_year_" + settings.id).val(year); } else { $("#mec_tile_month_" + settings.id + "_" + response.current_month.id).hide(); $("#mec_month_navigator_" + settings.id + "_" + response.current_month.id).hide(); } }, error: function(){} }); } } function toggleMonth(month_id) { var active_month = $("#mec_skin_" + settings.id + " .mec-month-container-selected").data("month-id"); var active_day = $("#mec_tile_month_" + settings.id + "_" + active_month + " .mec-selected-day").data("day"); if(active_day <= 9) active_day = "0" + active_day; // Toggle Month Navigator $("#mec_skin_" + settings.id + " .mec-month-navigator").hide(); $("#mec_month_navigator_" + settings.id + "_" + month_id).show(); // Toggle Month $("#mec_skin_" + settings.id + " .mec-month-container").hide().removeClass("mec-month-container-selected"); $("#mec_tile_month_" + settings.id + "_" + month_id).show().addClass("mec-month-container-selected"); } var sf; function setListeners() { $("#mec_skin_" + settings.id + " .mec-load-more-button").off("click").on("click", function() { loadMore(); }); $("#mec_skin_" + settings.id + " article").off("click").on("click", function(e) { // Link Clicked if(e.target.nodeName.toLowerCase() === 'a') return; var href = $(this).data('href'); if(!href) return; var target = $(this).data('target'); if(target === 'blank') window.open(href, '_blank'); else document.location.href = href; }); // Add the onclick event $("#mec_skin_" + settings.id + " .mec-has-event").off("click").on('click', function(e) { e.preventDefault(); // define variables var $this = $(this), data_mec_cell = $this.data('mec-cell'), month_id = $this.data('month'); $("#mec_monthly_view_month_" + settings.id + "_" + month_id + " .mec-calendar-day").removeClass('mec-selected-day'); $this.addClass('mec-selected-day'); $('#mec_month_side_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec:not([data-mec-cell=' + data_mec_cell + '])').slideUp(); $('#mec_month_side_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec[data-mec-cell=' + data_mec_cell + ']').slideDown(); $('#mec_monthly_view_month_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec:not([data-mec-cell=' + data_mec_cell + '])').slideUp(); $('#mec_monthly_view_month_' + settings.id + '_' + month_id + ' .mec-calendar-events-sec[data-mec-cell=' + data_mec_cell + ']').slideDown(); }); // Single Event Method if(settings.sed_method != '0') { sed(); } } function sed() { // Single Event Display $("#mec_skin_" + settings.id + " .mec-event-title a").off('click').on('click', function(e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } function loadMore() { // Load More Button var $load_more_button = $("#mec_skin_" + settings.id + " .mec-load-more-button"); // Add loading Class $load_more_button.addClass("mec-load-more-loading"); $.ajax( { url: settings.ajax_url, data: "action=mec_tile_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "¤t_month_divider=" + settings.current_month_divider + "&apply_sf_date=0", dataType: "json", type: "post", success: function(response) { if(response.count == '0') { // Remove loading Class $load_more_button.removeClass("mec-load-more-loading"); // Hide load more button $load_more_button.addClass("mec-util-hidden"); } else { // Show load more button $load_more_button.removeClass("mec-util-hidden"); // Append Items $("#mec_skin_events_" + settings.id).append(response.html); // Remove loading Class $load_more_button.removeClass("mec-load-more-loading"); // Update the variables settings.end_date = response.end_date; settings.offset = response.offset; settings.current_month_divider = response.current_month_divider; // Single Event Method if(settings.sed_method != '0') { sed(); } } }, error: function(){} }); } }; }(jQuery)); function mec_gateway_selected(gateway_id) { // Hide all gateway forms jQuery('.mec-book-form-gateway-checkout').addClass('mec-util-hidden'); // Show selected gateway form jQuery('#mec_book_form_gateway_checkout' + gateway_id).removeClass('mec-util-hidden'); } function mec_wrap_resize() { var $mec_wrap = jQuery('.mec-wrap'), mec_width = $mec_wrap.width(); if (mec_width < 959) { $mec_wrap.addClass('mec-sm959'); } else { $mec_wrap.removeClass('mec-sm959'); } } function get_parameter_by_name(name, url) { if (!url) { url = window.location.href; } name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } // Focus events day var mec_g_month_id = null; function mecFocusDay(settings) { if(mec_g_month_id != null) { setTimeout(function() { var id = settings.id, date = new Date(), mec_owl_year = mec_g_month_id.substr(0, 4), mec_current_year = date.getFullYear(), mec_owl_month = mec_g_month_id.substr(4, 6), mec_current_month = date.getMonth() + 1, mec_current_day = date.getDate(), mec_owl_go = jQuery("#mec-owl-calendar-d-table-" + id + "-" + mec_g_month_id), mec_day_exist = false; mec_owl_go.find('.owl-stage > div').each(function (index) { if(parseInt(jQuery(this).children('div').data("events-count")) > 0) { if((((mec_owl_year != mec_current_year) && (mec_owl_month != mec_current_month)) || (mec_owl_year == mec_current_year) && (mec_owl_month != mec_current_month)) || parseInt(jQuery(this).children('div').text()) > mec_current_day) { var index_plus = index + 1; jQuery('#mec_daily_view_day' + id + '_' + mec_g_month_id + (index < 10 ? '0' + index_plus : index_plus)).trigger('click'); mec_owl_go.trigger('to.owl.carousel', index_plus); mec_day_exist = true; return false; } else { jQuery('#mec_daily_view_day' + id + '_' + mec_g_month_id + mec_current_day).trigger('click'); mec_owl_go.trigger('to.owl.carousel', mec_current_day); mec_day_exist = true; return false; } } }); if(!mec_day_exist && ((mec_owl_year == mec_current_year) && (mec_owl_month == mec_current_month))) { jQuery('#mec_daily_view_day' + id + '_' + mec_g_month_id + mec_current_day).trigger('click'); mec_owl_go.trigger('to.owl.carousel', mec_current_day); } }, 1000); } } // Focus events week function mec_focus_week(id, skin) { skin = skin || 'weekly'; var wrap_elem = jQuery('.mec-weeks-container .mec-weekly-view-week-active').parent(); var days = wrap_elem.find('dt'); var week = wrap_elem.find('dl').length; var focus_week = false; var i = j = 1; for (i = 1; i < week; i++) { setTimeout(function () { var event = new Event('click'); jQuery('#mec_skin_' + id + ' .mec-previous-month.mec-load-week')[0].dispatchEvent(event); }, 33); } days.each(function (i) { if (jQuery(this).data('events-count') > 0) { if (focus_week === false) { focus_week = parseInt(jQuery(this).parent().data('week-number')); } if (skin == 'timetable') { if (parseInt(jQuery(this).parent().data('week-number')) == parseInt(jQuery('body').data('currentweek'))) { focus_week = parseInt(jQuery(this).parent().data('week-number')); return false; } } else { return false; } } }); if (focus_week !== false) { for (j = 1; j < focus_week; j++) { setTimeout(function () { var event = new Event('click'); jQuery('#mec_skin_' + id + ' .mec-next-month.mec-load-week')[0].dispatchEvent(event); }, 33); } } } // TODO must be cleaned JS codes (function ($) { $(document).ready(function () { // Check RTL website if ($('body').hasClass('rtl')) { var owl_rtl = true; } else { var owl_rtl = false; } // MEC WIDGET CAROUSEL $(".mec-widget .mec-event-grid-classic").addClass('mec-owl-carousel mec-owl-theme'); $(".mec-widget .mec-event-grid-classic").owlCarousel({ autoplay: true, autoplayTimeout: 3000, // Set AutoPlay to 3 seconds autoplayHoverPause: true, loop: true, dots: false, nav: true, navText: ["", " "], items: 1, autoHeight: true, responsiveClass: true, rtl: owl_rtl, }); // add mec-sm959 class if mec-wrap div size < 959 mec_wrap_resize(); jQuery(window).bind('resize', function () { mec_wrap_resize(); }); // Fixed: social hover in iphone $('.mec-event-sharing-wrap').hover(function () { $(this).find('.mec-event-sharing').show(0); }, function () { $(this).find('.mec-event-sharing').hide(0); }); // Register Booking Smooth Scroll $('a.simple-booking[href^="#mec-events-meta-group-booking"]').click(function () { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { var scrollTopVal = target.offset().top - 30; $('html, body').animate({ scrollTop: scrollTopVal }, 600); return false; } } }); // Load Information widget under title in mobile/tablet if ($('.single-mec-events .mec-single-event:not(".mec-single-modern")').length > 0) { if ($('.single-mec-events .mec-event-info-desktop.mec-event-meta.mec-color-before.mec-frontbox').length > 0) { var html = $('.single-mec-events .mec-event-info-desktop.mec-event-meta.mec-color-before.mec-frontbox')[0].outerHTML; if (Math.max(document.documentElement.clientWidth, window.innerWidth || 0) < 960) { $('.single-mec-events .col-md-4 .mec-event-info-desktop.mec-event-meta.mec-color-before.mec-frontbox').remove(); $('.single-mec-events .mec-event-info-mobile').html(html) } } } }); })(jQuery); // Weather (function ($) { // Convart fahrenheit to centigrade function convertToC(value) { return Math.round(((parseFloat(value) - 32) * 5 / 9)); } // Convert centigrade to fahrenheit function convertToF(value) { return Math.round(((1.8 * parseFloat(value)) + 32)); } // Convert miles to kilometers function MPHToKPH(value) { return Math.round(1.609344 * parseFloat(value)); } // Convert kilometers to miles function KPHToMPH(value) { return Math.round((0.6214 * parseFloat(value))); } $(document).ready(function ($) { var degree = $('.mec-weather-summary-temp'); var weather_extra = $('.mec-weather-extras'); var wind = weather_extra.children('.mec-weather-wind'); var visibility = weather_extra.children('.mec-weather-visibility'); var feelslike = weather_extra.children('.mec-weather-feels-like'); // Events $('.degrees-mode').on('click', function() { var degree_mode = degree.children('var').text().trim(); var wind_text = wind.text().substring(5); var visibility_text = visibility.text().substring(11); var feelslike_text = feelslike.text().substring(12); if(degree_mode == degree.data('c').trim()) { degree.html(convertToF(parseInt(degree.text())) + ' ' + degree.data('f') + ''); feelslike.html('Feels Like: ' + convertToF(parseInt(feelslike_text)) + ' ' + feelslike.data('f') + ''); wind.html('Wind: ' + KPHToMPH(parseInt(wind_text)) + '' + wind.data('mph') + ''); visibility.html('Visibility: ' + KPHToMPH(parseInt(visibility_text)) + '' + visibility.data('mph') + ''); $(this).text($(this).data('metric')); } else if(degree_mode == degree.data('f').trim()) { degree.html(convertToC(parseInt(degree.text())) + ' ' + degree.data('c') + ''); feelslike.html('Feels Like: ' + convertToC(parseInt(feelslike_text)) + ' ' + feelslike.data('c') + ''); wind.html('Wind: ' + MPHToKPH(parseInt(wind_text)) + '' + wind.data('kph') + ''); visibility.html('Visibility: ' + MPHToKPH(parseInt(visibility_text)) + '' + visibility.data('kph') + ''); $(this).text($(this).data('imperial')); } }); $('a').on('click', function () {}); // FES Speakers Adding $('#mec_add_speaker_button').on('click', function () { var $this = this; var content = $($this).parent().find('input'); var list = $('#mec-fes-speakers-list'); var key = list.find('.mec-error').length; $($this).prop("disabled", true).css('cursor', 'wait'); $.post(ajaxurl, { action: "speaker_adding", content: content.val(), key: key }) .done(function (data) { if ($(data).hasClass('mec-error')) { list.prepend(data); setTimeout(function () { $('#mec-speaker-error-${key}').remove(); }, 1500); } else { list.html(data); content.val(''); } $($this).prop("disabled", false).css('cursor', 'pointer'); }); }); // Check RTL website var owl_rtl = $('body').hasClass('rtl') ? true : false; // MEC FES Date Wrappers var fes_export_list = $('.mec-export-list-wrapper'); // MEC FES Date Item Event fes_export_list.find('.mec-export-list-item').click(function() { $('.mec-export-list-item').removeClass('fes-export-date-active'); $(this).addClass('fes-export-date-active'); }); // MEC BuddyPress Integration Attendees Modules var mec_bd_attendees_modules = $('.mec-attendees-list-details > ul > li'); mec_bd_attendees_modules.click(function() { $(this).find('.mec-attendees-toggle').toggle(); }); // MEC FES export csv $('.mec-event-export-csv, .mec-event-export-excel').click(function() { var mec_event_id = $(this).parent().parent().data('event-id'); var time = $(this).parent().parent().find($('.fes-export-date-active')).data('time'); if(typeof time === 'undefined') time = 0; $.ajax( { url: mecdata.ajax_url, data: "action=mec_fes_csv_export&fes_nonce=" + mecdata.fes_nonce + "&mec_event_id=" + mec_event_id + "×tamp=" + time, dataType: 'json', type: "post", success: function (res) { if(res.ex != 'error') { var $csv = $(''); $csv.attr('href', res.ex); $('body').append($csv); $csv.attr('download', 'bookings-' + res.name + '.csv'); $csv[0].click(); $csv.remove(); } }, error: function () {} }); }); }); })(jQuery); function mec_book_form_submit(event, unique_id) { event.preventDefault(); window["mec_book_form_submit" + unique_id](); } function mec_book_form_back_btn_cache(context, unique_id) { var id = jQuery(context).attr('id'); var mec_form_data = jQuery('#mec_book_form' + unique_id).serializeArray(); if(id == "mec-book-form-btn-step-1") jQuery('body').data('mec-book-form-step-1', jQuery('#mec_booking' + unique_id).html()).data('unique-id', unique_id).data('mec-book-form-data-step-1', mec_form_data); else if(id == "mec-book-form-btn-step-2") jQuery('body').data('mec-book-form-step-2', jQuery('#mec_booking' + unique_id).html()).data('mec-book-form-data-step-2', mec_form_data); } function mec_agreement_change(context) { var status = jQuery(context).is(":checked"); if(status) jQuery(context).prop("checked", "checked"); else jQuery(context).removeProp("checked"); } function mec_book_form_back_btn_click(context, unique_id) { var id = jQuery(context).attr('id'); unique_id = jQuery('body').data('unique-id'); jQuery('#mec_booking_message' + unique_id).hide(); if(id == "mec-book-form-back-btn-step-2") { var mec_form_data_step_1 = jQuery('body').data('mec-book-form-data-step-1'); jQuery('#mec_booking' + unique_id).html(jQuery('body').data('mec-book-form-step-1')); jQuery.each(mec_form_data_step_1, function(index, object_item) { jQuery('[name="' + object_item.name + '"]').val(object_item.value); }); // Booking Refresh Recaptcha When Back Button Click. var recaptcha_check = jQuery('#mec_booking' + unique_id).find('#g-recaptcha').length; if(recaptcha_check != 0) { jQuery('#g-recaptcha').html(''); grecaptcha.render("g-recaptcha", { sitekey: mecdata.recapcha_key }); } } else if(id == "mec-book-form-back-btn-step-3") { var mec_form_data_step_2 = jQuery('body').data('mec-book-form-data-step-2'); jQuery('#mec_booking' + unique_id).html(jQuery('body').data('mec-book-form-step-2')); jQuery.each(mec_form_data_step_2, function(index, object_item) { var mec_elem = jQuery('[name="'+ object_item.name +'"]'); var mec_type = mec_elem.attr('type'); if((mec_type == 'checkbox' || mec_type == 'radio')) { var mec_elem_len = jQuery('[name="'+ object_item.name +'"]').length; if(mec_elem_len > 1) { var id = '#' + mec_elem.attr('id').match(/mec_book_reg_field_reg.*_/g) + object_item.value.toLowerCase(); jQuery(id).prop('checked', true); } else { mec_elem.prop('checked', true); } } mec_elem.val(object_item.value); }); } } // Google map Skin function gmapSkin(NewJson) { var gmap_temp = jQuery("#gmap-data"); var beforeJson = gmap_temp.val(); if (typeof beforeJson === 'undefined') beforeJson = ''; var newJson = NewJson; var jsonPush = (typeof beforeJson != 'undefined' && beforeJson.trim() == "") ? [] : JSON.parse(beforeJson); var pushState = jsonPush.length < 1 ? false : true; for (var key in newJson) { if (pushState) { jsonPush.forEach(function (Item, Index) { var render_location = jsonPush[Index].latitude + "," + jsonPush[Index].longitude; if (key.trim() == render_location.trim()) { // LightBox Count Update newJson[key].count = newJson[key].count + jsonPush[Index].count; // LightBox Ids Update newJson[key].event_ids = newJson[key].event_ids.concat(jsonPush[Index].event_ids); // LightBox Initialize var dom = jQuery(newJson[key].lightbox).find("div:nth-child(2)"); var main_items = dom.html(); var new_items = jQuery(jsonPush[Index].lightbox).find("div:nth-child(2)").html(); var render_items = dom.html(main_items + new_items).html(); var new_info_lightbox = '
' + newJson[key].name + '
' + render_items + '
'; newJson[key].lightbox = new_info_lightbox; // LightBox info var new_info_window = '
' + newJson[key].count + '
Event at this location' + newJson[key].name + '
'; newJson[key].infowindow = new_info_window; // Remove before values of this location jsonPush.splice(Index, 1); } }); } jsonPush.push(newJson[key]); } gmap_temp.val(JSON.stringify(jsonPush)); return jsonPush; } // Fluent Scripts jQuery(document).ready(function () { if (jQuery('.mec-fluent-wrap').length < 0) { return; } // Events jQuery(window).on('resize', mecFluentToggoleDisplayValueFilterContent); jQuery(document).on('click', '.mec-fluent-wrap .mec-filter-icon', mecFluentToggleFilterContent); jQuery(document).on('click', '.mec-fluent-wrap .mec-more-events-icon', mecFluentToggleMoreEvents); jQuery(document).on('click', '.mec-fluent-wrap .mec-yearly-calendar', mecFluentYearlyCalendar); jQuery(document).on('click', mecFluentOutsideEvent); jQuery(document).on('click', '.mec-fluent-more-views-icon', mecFluentMoreViewsContent); jQuery(document).on('change', '.mec-fluent-wrap .mec-filter-content select, .mec-fluent-wrap .mec-filter-content input', mecFluentSmartFilterIcon); // Run mecFluentTimeTableUI(); mecFluentUI(); mecFluentNiceSelect(); mecFluentWrapperFullScreenWidth(); jQuery(window).on('load', mecFluentWrapperFullScreenWidth); jQuery(window).on('load', mecFluentCurrentTimePosition); jQuery(window).on('resize', mecFluentWrapperFullScreenWidth); jQuery(window).on('resize', mecFluentTimeTableUI); mecFluentSliderUI(); mecFluentFullCalendar(); jQuery(window).on('resize', mecFluentFullCalendar); mecFluentCustomScrollbar(); }); function mecFluentSinglePage() { if (jQuery().niceScroll) { jQuery('.mec-single-fluent-body .featherlight .mec-single-fluent-wrap').niceScroll({ horizrailenabled:false, cursorcolor: '#C1C5C9', cursorwidth: '4px', cursorborderradius: '4px', cursorborder: 'none', railoffset: { left: 10, } }); } } function mecFluentFullCalendar() { if (jQuery('.mec-fluent-wrap.mec-skin-full-calendar-container').length > 0) { var widowWidth = jQuery(window).innerWidth(); if (widowWidth<=767) { jQuery('.mec-fluent-wrap.mec-skin-full-calendar-container .mec-skin-monthly-view-month-navigator-container, .mec-fluent-wrap.mec-skin-full-calendar-container .mec-calendar-a-month, .mec-fluent-wrap.mec-skin-full-calendar-container .mec-yearly-title-sec').css({ paddingTop: jQuery('.mec-fluent-wrap.mec-skin-full-calendar-container').children('.mec-totalcal-box').height() + 40, }); } else { jQuery('.mec-fluent-wrap.mec-skin-full-calendar-container .mec-skin-monthly-view-month-navigator-container, .mec-fluent-wrap.mec-skin-full-calendar-container .mec-calendar-a-month, .mec-fluent-wrap.mec-skin-full-calendar-container .mec-yearly-title-sec').css({ paddingTop: 32, }); } } } function mecFluentSmartFilterIcon() { var filterContent = jQuery(this).closest('.mec-filter-content'); var hasValue = false; if (jQuery(this).closest('.mec-date-search').length > 0) { var yearValue = jQuery(this).closest('.mec-date-search').find('select[id*="mec_sf_year"]').val(); var monthValue = jQuery(this).closest('.mec-date-search').find('select[id*="mec_sf_month"]').val(); if ((yearValue == 'none' && monthValue == 'none') || (yearValue != 'none' && monthValue != 'none')) { filterContent.hide(); if ((yearValue != 'none' && monthValue != 'none')) { hasValue = true; } else { hasValue = false; } } else { return false; } } else { filterContent.hide(); } if (!hasValue) { filterContent.find(':not(.mec-date-search)').find('select, input:not([type="hidden"])').each(function () { if (jQuery(this).val()) { hasValue = true; return false; } }); } if (hasValue) { jQuery(this).closest('.mec-search-form').find('.mec-filter-icon').addClass('active'); } else { jQuery(this).closest('.mec-search-form').find('.mec-filter-icon').removeClass('active'); } } function mecFluentMoreViewsContent() { jQuery(this).find('.mec-fluent-more-views-content').toggleClass('active'); } function mecFluentWrapperFullScreenWidth() { if (jQuery('.mec-fluent-bg-wrap').length > 0) { jQuery('.mec-fluent-bg-wrap').css({ maxWidth: jQuery('body').width() + 8, }); } } function mecFluentUI() { if (typeof mecdata.enableSingleFluent != 'undefined' && mecdata.enableSingleFluent) { jQuery('body').addClass('mec-single-fluent-body'); } // Set filter content position jQuery(window).on('load resize', function () { if (jQuery('.mec-filter-content').length > 0) { jQuery('.mec-filter-content').css({ right: -(jQuery('.mec-calendar').width() - jQuery('.mec-search-form.mec-totalcal-box').position().left - jQuery('.mec-search-form.mec-totalcal-box').width() + 40), left: -jQuery('.mec-search-form.mec-totalcal-box').position().left + 40, }); } if (jQuery('.mec-filter-icon').is(':visible')) { var filterIconLeftPosition = parseInt(jQuery('.mec-search-form.mec-totalcal-box').position().left) + parseInt(jQuery('.mec-filter-icon').position().left) - 25; jQuery('head').find('style[title="mecFluentFilterContentStyle"]').remove().end().append(''); } }); // Hide empty filter content if (jQuery('.mec-filter-content').is(':empty')) { jQuery('.mec-filter-icon').hide(); } // Prevend Default For Event Share Icon jQuery(document).on('click', '.mec-event-share-icon', function(e) { e.preventDefault(); }); } function mecFluentCurrentTimePosition() { if (jQuery('.mec-fluent-wrap').length > 0) { jQuery('.mec-fluent-current-time').each(function() { var currentTimeMinutes = jQuery(this).data('time'); var height = jQuery(this).closest('.mec-fluent-current-time-cell').height(); jQuery(this).css({ top: (currentTimeMinutes / 60) * height, }); }); } } function mecFluentNiceSelect() { if (jQuery('.mec-fluent-wrap').length < 0) { return; } if (jQuery().niceSelect) { jQuery('.mec-fluent-wrap').find('.mec-filter-content').find('select').niceSelect(); } } function mecFluentCustomScrollbar(y) { if (jQuery('.mec-fluent-wrap').length < 0) { return; } if (jQuery().niceScroll) { jQuery('.mec-custom-scrollbar').niceScroll({ cursorcolor: '#C7EBFB', cursorwidth: '4px', cursorborderradius: '4px', cursorborder: 'none', railoffset: { left: -2, } }); jQuery('.mec-custom-scrollbar').getNiceScroll().resize(); jQuery('.mec-custom-scrollbar').each(function () { if (jQuery(this).find('.mec-fluent-current-time-cell').length > 0) { var parentTopOffset = jQuery(this).offset().top; var currentTimeCellOffset = jQuery(this).find('.mec-fluent-current-time-cell').offset().top; jQuery(this).getNiceScroll(0).doScrollTop(currentTimeCellOffset - parentTopOffset - 16, 120); jQuery(this).on('scroll', function () { if (jQuery(this).getNiceScroll(0).scroll.y != 0) { jQuery(this).addClass('mec-scrolling'); } else { jQuery(this).removeClass('mec-scrolling'); } }); } if (typeof y != 'undefined') { if (jQuery(this).closest('.mec-skin-list-wrap').length > 0 || jQuery(this).closest('.mec-skin-grid-wrap').length > 0) { jQuery(this).getNiceScroll(0).doScrollTop(0, 120); } } }); } } function mecFluentTimeTableUI() { jQuery('.mec-fluent-wrap.mec-timetable-wrap .mec-cell').css('min-height', 0); var maxHeight = Math.max.apply(null, jQuery('.mec-fluent-wrap.mec-timetable-wrap .mec-cell').map(function () { return jQuery(this).height(); }).get()); maxHeight = maxHeight > 87 ? maxHeight : 87; jQuery('.mec-fluent-wrap.mec-timetable-wrap .mec-cell').css('min-height', maxHeight + 2); } function mecFluentSliderUI() { jQuery(window).on('load', function () { jQuery('.mec-fluent-wrap.mec-skin-slider-container .owl-next').prepend('Next'); jQuery('.mec-fluent-wrap.mec-skin-slider-container .owl-prev').append('Prev'); }); } function mecFluentToggleFilterContent(e) { e.preventDefault(); if (jQuery('.mec-filter-content').is(':visible')) { jQuery('.mec-filter-content').css({ display: 'none', }); } else { const displayValue = jQuery(window).width() <= 790 ? 'block' : 'flex'; jQuery('.mec-filter-content').css({ display: displayValue, }); } } function mecFluentToggoleDisplayValueFilterContent() { const displayValue = jQuery(window).width() <= 767 ? 'block' : 'flex'; if (jQuery('.mec-filter-content').is(':visible')) { jQuery('.mec-filter-content').css({ display: displayValue, }); } } function mecFluentToggleMoreEvents(e) { e.preventDefault(); const moreEventsWrap = jQuery(this).siblings('.mec-more-events-wrap'); const moreEvents = moreEventsWrap.children('.mec-more-events'); jQuery('.mec-more-events-wrap').removeClass('active'); moreEventsWrap.addClass('active'); jQuery('.mec-more-events-wrap:not(.active)').hide(); if (moreEventsWrap.is(':visible')) { moreEventsWrap.hide(); } else { topElement = moreEventsWrap.closest('.mec-more-events-inner-controller').length > 0 ? moreEventsWrap.closest('.mec-more-events-inner-controller') : moreEventsWrap.closest('.mec-more-events-controller'); moreEventsWrap.show().css({ top: topElement.offset().top - window.scrollY, left: moreEventsWrap.closest('.mec-more-events-controller').offset().left, width: moreEventsWrap.closest('.mec-more-events-controller').width(), }); if (moreEventsWrap.width() > 400) { moreEvents.css({ left: (moreEventsWrap.width() / 2) - (moreEvents.width() / 2), width: 400, }); } else { moreEvents.css({ width: moreEventsWrap.width(), left: 0, }); } } } function mecFluentOutsideEvent(e) { if (!jQuery(e.target).is('.mec-more-events-icon') && !jQuery(e.target).closest('.mec-more-events-wrap').length) { jQuery('.mec-more-events-wrap').hide(); } if (!jQuery(e.target).is('.mec-filter-icon') && !jQuery(e.target).closest('.mec-filter-content').length) { jQuery('.mec-filter-content').hide(); } if (!jQuery(e.target).is('.mec-fluent-more-views-icon') && !jQuery(e.target).closest('.mec-fluent-more-views-content').length) { jQuery('.mec-fluent-more-views-content').removeClass('active'); } } function mecFluentYearlyCalendar() { const monthNum = jQuery(this).data('month'); const monthName = jQuery(this).find('.mec-calendar-table-title').text(); jQuery('.mec-fluent-wrap').find('.mec-yearly-calendar').removeClass('active'); jQuery(this).addClass('active') .closest('.mec-year-container') .find('.mec-yearly-agenda-sec-title span').text(monthName).end() .find('.mec-events-agenda').addClass('mec-util-hidden').end() .find('.mec-events-agenda[data-month=' + monthNum + ']').removeClass('mec-util-hidden'); mecFluentCustomScrollbar(); } function mecFluentYearlyUI(eventID, yearID) { var fluentWrap = jQuery('#mec_skin_' + eventID + '.mec-fluent-wrap'); if (fluentWrap.length < 0) { return; } var monthNum = fluentWrap.find('.mec-year-container[data-year-id=' + yearID + ']').find('.mec-events-agenda:not(.mec-util-hidden)').data('month'); var activeMonth = fluentWrap.find('.mec-year-container[data-year-id=' + yearID + ']').find('.mec-yearly-calendar[data-month=' + monthNum + ']'); var activeMonthName = activeMonth.find('.mec-calendar-table-title').text(); activeMonth.addClass('active'); } // MEC LIST VIEW Fluent PLUGIN (function ($) { $.fn.mecListViewFluent = function (options) { var active_month; var active_year; // Default Options var settings = $.extend({ // These are the defaults. today: null, id: 0, events_label: 'Events', event_label: 'Event', month_navigator: 0, atts: '', active_month: {}, next_month: {}, sf: {}, ajax_url: '', }, options); mecFluentCustomScrollbar(); initLoadMore('#mec_list_view_month_' + settings.id + '_' + settings.month_id); function initLoadMore(monthID) { $(monthID).off().on('click', '.mec-load-more-button', function () { loadMore(this); }); } function loadMore(This) { // Add loading Class var currentLoadMore = $(This); currentLoadMore.addClass("mec-load-more-loading"); var endDate = currentLoadMore.data('end-date'); var maximumDate = currentLoadMore.data('maximum-date'); var nextOffset = currentLoadMore.data('next-offset'); var year = currentLoadMore.data('year'); var month = currentLoadMore.data('month'); $.ajax({ url: settings.ajax_url, data: "action=mec_list_load_more&mec_year=" + year + "&mec_month=" + month + "&mec_maximum_date=" + maximumDate + "&mec_start_date=" + endDate + "&mec_offset=" + nextOffset + "&" + settings.atts + "¤t_month_divider=0&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { currentLoadMore.parent().remove(); if (response.count != '0') { // Append Items $('#mec_list_view_month_' + settings.id + '_' + response.current_month.id).append(response.month); // Single Event Method if (settings.sed_method != '0') { sed(); } mecFluentCustomScrollbar(); initLoadMore('#mec_list_view_month_' + settings.id + '_' + response.current_month.id); } }, error: function () {} }); } // Initialize Month Navigator if (settings.month_navigator) initMonthNavigator(); // Load Next Month in background setMonth(settings.next_month.year, settings.next_month.month, true); var initMonth; var initYear; active_month = initMonth = settings.active_month.month; active_year = initYear = settings.active_month.year; // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(active_year, active_month); } }); } // Single Event Method if (settings.sed_method != '0') { sed(); } function initMonthNavigator() { $("#mec_skin_" + settings.id + " .mec-load-month").off().on("click", function () { var year = $(this).data("mec-year"); var month = $(this).data("mec-month"); setMonth(year, month, false, true); }); } function parseQuery(queryString) { var query = {}; var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&'); for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split('='); query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || ''); } return query; } function updateQueryStringParameter(uri, key, val) { return uri .replace(RegExp("([?&]" + key + "(?=[=&#]|$)[^#&]*|(?=#|$))"), "&" + key + "=" + encodeURIComponent(val)) .replace(/^([^?&]+)&/, "$1?"); } function search(year, month) { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); var ObjAtts = parseQuery(settings.atts); if (!(ObjAtts['sf[month'] || ObjAtts['sf[year]'])) { settings.atts = updateQueryStringParameter(settings.atts.trim(), 'sf[year]', initYear); settings.atts = updateQueryStringParameter(settings.atts.trim(), 'sf[month]', initMonth); } $.ajax({ url: settings.ajax_url, data: "action=mec_list_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { active_month = response.current_month.month; active_year = response.current_month.year; // Append Month $("#mec_skin_events_" + settings.id).html('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-list-view-month-navigator-container").html('
' + response.navigator + '
'); // Re-initialize Month Navigator initMonthNavigator(); // Toggle Month toggleMonth(response.current_month.id); initLoadMore('#mec_list_view_month_' + settings.id + '_' + response.current_month.id); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); mecFluentCustomScrollbar(); }, error: function () {} }); } function setMonth(year, month, do_in_background, navigator_click) { if (typeof do_in_background === "undefined") do_in_background = false; navigator_click = navigator_click || false; var month_id = year + "" + month; if (!do_in_background) { active_month = month; active_year = year; } // Month exists so we just show it if ($("#mec_list_view_month_" + settings.id + "_" + month_id).length) { // Toggle Month toggleMonth(month_id); mecFluentCustomScrollbar(0); } else { if (!do_in_background) { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); } $.ajax({ url: settings.ajax_url, data: "action=mec_list_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigator_click, dataType: "json", type: "post", success: function (response) { // Append Month $("#mec_skin_events_" + settings.id).append('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-list-view-month-navigator-container").append('
' + response.navigator + '
'); // Re-initialize Month Navigator initMonthNavigator(); initLoadMore('#mec_list_view_month_' + settings.id + '_' + response.current_month.id); if (!do_in_background) { // Toggle Month toggleMonth(response.current_month.id); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Set Month Filter values in search widget $("#mec_sf_month_" + settings.id).val(month); $("#mec_sf_year_" + settings.id).val(year); } else { $("#mec_list_view_month_" + settings.id + "_" + response.current_month.id).hide(); $("#mec_month_navigator_" + settings.id + "_" + response.current_month.id).hide(); } if (typeof custom_month !== undefined) var custom_month; if (typeof custom_month != undefined) { if (custom_month == 'true') { $(".mec-month-container .mec-calendar-day").removeClass('mec-has-event'); $(".mec-month-container .mec-calendar-day").removeClass('mec-selected-day'); $('.mec-calendar-day').unbind('click'); } } if (!do_in_background) { mecFluentCustomScrollbar(0); } }, error: function () {} }); } } function toggleMonth(month_id) { var active_month = $("#mec_skin_" + settings.id + " .mec-month-container-selected").data("month-id"); var active_day = $("#mec_list_view_month_" + settings.id + "_" + active_month + " .mec-selected-day").data("day"); if (active_day <= 9) active_day = "0" + active_day; // Toggle Month Navigator $("#mec_skin_" + settings.id + " .mec-month-navigator").hide(); $("#mec_month_navigator_" + settings.id + "_" + month_id).show(); // Toggle Month $("#mec_skin_" + settings.id + " .mec-month-container").hide(); $("#mec_list_view_month_" + settings.id + "_" + month_id).show(); // Add selected class $("#mec_skin_" + settings.id + " .mec-month-container").removeClass("mec-month-container-selected"); $("#mec_list_view_month_" + settings.id + "_" + month_id).addClass("mec-month-container-selected"); } var sf; function sed() { // Single Event Display $(".mec-skin-list-wrap#mec_skin_" + settings.id).off('click').on('click', '[data-event-id]', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } }; }(jQuery)); // MEC Grid VIEW Fluent PLUGIN (function ($) { $.fn.mecGridViewFluent = function (options) { var active_month; var active_year; // Default Options var settings = $.extend({ // These are the defaults. today: null, id: 0, events_label: 'Events', event_label: 'Event', month_navigator: 0, atts: '', active_month: {}, next_month: {}, sf: {}, ajax_url: '', }, options); initLoadMore('#mec_grid_view_month_' + settings.id + '_' + settings.month_id); function initLoadMore(monthID) { $(monthID).off().on('click', '.mec-load-more-button', function () { loadMore(this); }); } function loadMore(This) { // Add loading Class var currentLoadMore = $(This); currentLoadMore.addClass("mec-load-more-loading"); var endDate = currentLoadMore.data('end-date'); var maximumDate = currentLoadMore.data('maximum-date'); var nextOffset = currentLoadMore.data('next-offset'); var year = currentLoadMore.data('year'); var month = currentLoadMore.data('month'); $.ajax({ url: settings.ajax_url, data: "action=mec_grid_load_more&mec_year=" + year + "&mec_month=" + month + "&mec_maximum_date=" + maximumDate + "&mec_start_date=" + endDate + "&mec_offset=" + nextOffset + "&" + settings.atts + "¤t_month_divider=0&apply_sf_date=0", dataType: "json", type: "post", success: function (response) { currentLoadMore.parent().remove(); if (response.count != '0') { // Append Items $('#mec_grid_view_month_' + settings.id + '_' + response.current_month.id).append(response.month); // Single Event Method if (settings.sed_method != '0') { sed(); } mecFluentCustomScrollbar(); initLoadMore('#mec_grid_view_month_' + settings.id + '_' + response.current_month.id); } }, error: function () {} }); } // Initialize Month Navigator if (settings.month_navigator) initMonthNavigator(); // Load Next Month in background setMonth(settings.next_month.year, settings.next_month.month, true); var initMonth; var initYear; active_month = initMonth = settings.active_month.month; active_year = initYear = settings.active_month.year; // Search Widget if (settings.sf.container !== '') { sf = $(settings.sf.container).mecSearchForm({ id: settings.id, atts: settings.atts, callback: function (atts) { settings.atts = atts; search(active_year, active_month); } }); } // Single Event Method if (settings.sed_method != '0') { sed(); } function initMonthNavigator() { $("#mec_skin_" + settings.id + " .mec-load-month").off().on("click", function () { var year = $(this).data("mec-year"); var month = $(this).data("mec-month"); setMonth(year, month, false, true); }); } function parseQuery(queryString) { var query = {}; var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&'); for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split('='); query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || ''); } return query; } function updateQueryStringParameter(uri, key, val) { return uri .replace(RegExp("([?&]" + key + "(?=[=&#]|$)[^#&]*|(?=#|$))"), "&" + key + "=" + encodeURIComponent(val)) .replace(/^([^?&]+)&/, "$1?"); } function search(year, month) { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); var ObjAtts = parseQuery(settings.atts); if (!(ObjAtts['sf[month'] || ObjAtts['sf[year]'])) { settings.atts = updateQueryStringParameter(settings.atts.trim(), 'sf[year]', initYear); settings.atts = updateQueryStringParameter(settings.atts.trim(), 'sf[month]', initMonth); } $.ajax({ url: settings.ajax_url, data: "action=mec_grid_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=1", dataType: "json", type: "post", success: function (response) { active_month = response.current_month.month; active_year = response.current_month.year; // Append Month $("#mec_skin_events_" + settings.id).html('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-grid-view-month-navigator-container").html('
' + response.navigator + '
'); // Re-initialize Month Navigator initMonthNavigator(); // Toggle Month toggleMonth(response.current_month.id); initLoadMore('#mec_grid_view_month_' + settings.id + '_' + response.current_month.id); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); mecFluentCustomScrollbar(); }, error: function () {} }); } function setMonth(year, month, do_in_background, navigator_click) { if (typeof do_in_background === "undefined") do_in_background = false; navigator_click = navigator_click || false; var month_id = year + "" + month; if (!do_in_background) { active_month = month; active_year = year; } // Month exists so we just show it if ($("#mec_grid_view_month_" + settings.id + "_" + month_id).length) { // Toggle Month toggleMonth(month_id); mecFluentCustomScrollbar(); } else { if (!do_in_background) { // Add Loading Class if (jQuery('.mec-modal-result').length === 0) jQuery('.mec-wrap').append('
'); jQuery('.mec-modal-result').addClass('mec-month-navigator-loading'); } $.ajax({ url: settings.ajax_url, data: "action=mec_grid_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts + "&apply_sf_date=0" + "&navigator_click=" + navigator_click, dataType: "json", type: "post", success: function (response) { // Append Month $("#mec_skin_events_" + settings.id).append('
' + response.month + '
'); // Append Month Navigator $("#mec_skin_" + settings.id + " .mec-skin-grid-view-month-navigator-container").append('
' + response.navigator + '
'); // Re-initialize Month Navigator initMonthNavigator(); initLoadMore('#mec_grid_view_month_' + settings.id + '_' + response.current_month.id); if (!do_in_background) { // Toggle Month toggleMonth(response.current_month.id); // Remove loading Class $('.mec-modal-result').removeClass("mec-month-navigator-loading"); // Set Month Filter values in search widget $("#mec_sf_month_" + settings.id).val(month); $("#mec_sf_year_" + settings.id).val(year); } else { $("#mec_grid_view_month_" + settings.id + "_" + response.current_month.id).hide(); $("#mec_month_navigator_" + settings.id + "_" + response.current_month.id).hide(); } if (typeof custom_month !== undefined) var custom_month; if (typeof custom_month != undefined) { if (custom_month == 'true') { $(".mec-month-container .mec-calendar-day").removeClass('mec-has-event'); $(".mec-month-container .mec-calendar-day").removeClass('mec-selected-day'); $('.mec-calendar-day').unbind('click'); } } if (!do_in_background) { mecFluentCustomScrollbar(); } }, error: function () {} }); } } function toggleMonth(month_id) { var active_month = $("#mec_skin_" + settings.id + " .mec-month-container-selected").data("month-id"); var active_day = $("#mec_grid_view_month_" + settings.id + "_" + active_month + " .mec-selected-day").data("day"); if (active_day <= 9) active_day = "0" + active_day; // Toggle Month Navigator $("#mec_skin_" + settings.id + " .mec-month-navigator").hide(); $("#mec_month_navigator_" + settings.id + "_" + month_id).show(); // Toggle Month $("#mec_skin_" + settings.id + " .mec-month-container").hide(); $("#mec_grid_view_month_" + settings.id + "_" + month_id).show(); // Add selected class $("#mec_skin_" + settings.id + " .mec-month-container").removeClass("mec-month-container-selected"); $("#mec_grid_view_month_" + settings.id + "_" + month_id).addClass("mec-month-container-selected"); } var sf; function sed() { // Single Event Display $(".mec-skin-grid-wrap#mec_skin_" + settings.id).off('click').on('click', '[data-event-id]', function (e) { e.preventDefault(); var href = $(this).attr('href'); var id = $(this).data('event-id'); var occurrence = get_parameter_by_name('occurrence', href); var time = get_parameter_by_name('time', href); mecSingleEventDisplayer.getSinglePage(id, occurrence, time, settings.ajax_url, settings.sed_method, settings.image_popup); }); } }; }(jQuery)); // Booking Shortcode Scripts jQuery(document).ready(function () { if (jQuery('.mec-booking-shortcode').length < 0) { return; } // Events if (jQuery().niceSelect) { jQuery('.mec-booking-shortcode').find('.mec-book-first').find('select').niceSelect(); } }); // source --> https://www.opiceblum.com.br/en/wp-content/plugins/modern-events-calendar-lite/assets/js/events.js?ver=5.13.6 // Set datepicker default value. var datepicker_format = 'yy-mm-dd'; jQuery(document).ready(function($) { // Image picker on terms menu $('.mec_upload_image_button').click(function(event) { event.preventDefault(); var frame; if(frame) { frame.open(); return; } frame = wp.media(); frame.on('select', function() { // Grab the selected attachment. var attachment = frame.state().get('selection').first(); $('#mec_thumbnail_img').html(''); $('#mec_thumbnail').val(attachment.attributes.url); $('.mec_remove_image_button').toggleClass('mec-util-hidden'); frame.close(); }); frame.open(); }); // Image remover on terms menu $('.mec_remove_image_button').click(function(event) { event.preventDefault(); $('#mec_thumbnail_img').html(''); $('#mec_thumbnail').val(''); $('.mec_remove_image_button').toggleClass('mec-util-hidden'); }); // Image picker on add event menu for location $('.mec_location_upload_image_button').click(function(event) { event.preventDefault(); var frame; if(frame) { frame.open(); return; } frame = wp.media(); frame.on('select', function() { // Grab the selected attachment. var attachment = frame.state().get('selection').first(); $('#mec_location_thumbnail_img').html(''); $('#mec_location_thumbnail').val(attachment.attributes.url); $('.mec_location_remove_image_button').toggleClass('mec-util-hidden'); frame.close(); }); frame.open(); }); // Image remover on add event menu for location $('.mec_location_remove_image_button').click(function(event) { event.preventDefault(); $('#mec_location_thumbnail_img').html(''); $('#mec_location_thumbnail').val(''); $('.mec_location_remove_image_button').toggleClass('mec-util-hidden'); }); // Image picker on add event menu for organizer $('.mec_organizer_upload_image_button').click(function(event) { event.preventDefault(); var frame; if(frame) { frame.open(); return; } frame = wp.media(); frame.on('select', function() { // Grab the selected attachment. var attachment = frame.state().get('selection').first(); $('#mec_organizer_thumbnail_img').html(''); $('#mec_organizer_thumbnail').val(attachment.attributes.url); $('.mec_organizer_remove_image_button').toggleClass('mec-util-hidden'); frame.close(); }); frame.open(); }); // Image remover on add event menu for organizer $('.mec_organizer_remove_image_button').click(function(event) { event.preventDefault(); $('#mec_organizer_thumbnail_img').html(''); $('#mec_organizer_thumbnail').val(''); $('.mec_organizer_remove_image_button').toggleClass('mec-util-hidden'); }); // Image remover on frontend event submission menu $('#mec_fes_remove_image_button').click(function(event) { event.preventDefault(); $('#mec_fes_thumbnail_img').html(''); $('#mec_fes_thumbnail').val(''); $('#mec_featured_image_file').val(''); $('#mec_fes_remove_image_button').addClass('mec-util-hidden'); }); // Location Image remover on frontend event submission menu $('#mec_fes_location_remove_image_button').click(function(event) { event.preventDefault(); $('#mec_fes_location_thumbnail_img').html(''); $('#mec_fes_location_thumbnail').val(''); $('#mec_fes_location_thumbnail_file').val(''); $('#mec_fes_location_remove_image_button').addClass('mec-util-hidden'); }); // Organizer Image remover on frontend event submission menu $('#mec_fes_organizer_remove_image_button').click(function(event) { event.preventDefault(); $('#mec_fes_organizer_thumbnail_img').html(''); $('#mec_fes_organizer_thumbnail').val(''); $('#mec_fes_organizer_thumbnail_file').val(''); $('#mec_fes_organizer_remove_image_button').addClass('mec-util-hidden'); }); if ( typeof mec_admin_localize !== 'undefined' ) { var date_splite = mec_admin_localize.datepicker_format.split( '&' ); if ( date_splite[0] !== undefined && date_splite.length == 2 ) { datepicker_format = date_splite[0]; } } else if ( typeof mecdata !== 'undefined' ) { var date_splite = mecdata.datepicker_format.split( '&' ); if ( date_splite[0] !== undefined && date_splite.length == 2 ) { datepicker_format = date_splite[0]; } } if ($.fn.datepicker) { $('#mec_start_date').datepicker( { changeYear: true, changeMonth: true, dateFormat: datepicker_format, gotoCurrent: true, yearRange: 'c-3:c+5', }); $('#mec_end_date').datepicker( { changeYear: true, changeMonth: true, dateFormat: datepicker_format, gotoCurrent: true, yearRange: 'c-3:c+5', }); $('#mec_date_repeat_end_at_date').datepicker( { changeYear: true, changeMonth: true, dateFormat: datepicker_format, gotoCurrent: true, yearRange: 'c-3:c+5', }); $('.mec_date_picker_dynamic_format').datepicker( { changeYear: true, changeMonth: true, dateFormat: datepicker_format, gotoCurrent: true, yearRange: 'c-3:c+5', }); $('.mec_date_picker').datepicker( { changeYear: true, changeMonth: true, dateFormat: 'yy-mm-dd', gotoCurrent: true, yearRange: 'c-3:c+5', }); } $('#mec_location_id').on('change', function() { mec_location_toggle(); }); $('#mec_organizer_id').on('change', function() { mec_organizer_toggle(); var mec_organizer_val = parseInt($(this).val()); var mec_additional_organizer = $(this).parent().parent().find('#mec-additional-organizer-wrap'); if(mec_organizer_val != 1) mec_additional_organizer.show(); else mec_additional_organizer.hide(); }); mec_location_toggle(); mec_organizer_toggle(); $('#mec_repeat').on('change', function() { mec_repeat_toggle(); }); mec_repeat_toggle(); $('#mec_repeat_type').on('change', function() { mec_repeat_type_toggle(); }); mec_repeat_type_toggle(); $('#mec_bookings_limit_unlimited').on('change', function() { mec_bookings_unlimited_toggle(); }); $('#mec_add_in_days').on('click', function() { var start = $('#mec_exceptions_in_days_start_date').val(); if(start === '') return false; var end = $('#mec_exceptions_in_days_end_date').val(); if(end === '') return false; var start_hour = $('#mec_exceptions_in_days_start_hour').val(); if(start_hour.length === 1) start_hour = '0'+start_hour; var start_minutes = $('#mec_exceptions_in_days_start_minutes').val(); if(start_minutes.length === 1) start_minutes = '0'+start_minutes; var start_ampm = $('#mec_exceptions_in_days_start_ampm').val(); if(typeof start_ampm === 'undefined') start_ampm = ''; var end_hour = $('#mec_exceptions_in_days_end_hour').val(); if(end_hour.length === 1) end_hour = '0'+end_hour; var end_minutes = $('#mec_exceptions_in_days_end_minutes').val(); if(end_minutes.length === 1) end_minutes = '0'+end_minutes; var end_ampm = $('#mec_exceptions_in_days_end_ampm').val(); if(typeof end_ampm === 'undefined') end_ampm = ''; var value = start + ':' + end + ':' + start_hour + '-' + start_minutes + '-' + start_ampm + ':' + end_hour + '-' + end_minutes + '-' + end_ampm; var label = start + ' ' + start_hour + ':' + start_minutes + ' ' + start_ampm + ' - ' + end + ' ' + end_hour + ':' + end_minutes + ' ' + end_ampm; // Don't add exactly same occurrences if($('#mec_in_days input[value="'+value+'"]').length > 0) return false; var $key = $('#mec_new_in_days_key'); var key = $key.val(); var html = $('#mec_new_in_days_raw').html().replace(/:i:/g, key).replace(/:val:/g, value).replace(/:label:/g, label); $('#mec_in_days').append(html); $key.val(parseInt(key)+1); }); $('#mec_add_not_in_days').on('click', function() { var date = $('#mec_exceptions_not_in_days_date').val(); if(date === '') return false; var key = $('#mec_new_not_in_days_key').val(); var html = $('#mec_new_not_in_days_raw').html().replace(/:i:/g, key).replace(/:val:/g, date); $('#mec_not_in_days').append(html); $('#mec_new_not_in_days_key').val(parseInt(key)+1); }); $('#mec_add_ticket_button').on('click', function() { var key = $('#mec_new_ticket_key').val(); var html = $('#mec_new_ticket_raw').html().replace(/:i:/g, key); $('#mec_tickets').append(html); $('#mec_new_ticket_key').val(parseInt(key)+1); $('.mec_add_price_date_button').off('click').on('click', function() { mec_handle_add_price_date_button(this); }); }); $('.mec_add_price_date_button').off('click').on('click', function() { mec_handle_add_price_date_button(this); }); $('#mec_add_hourly_schedule_day_button').on('click', function() { var key = $('#mec_new_hourly_schedule_day_key').val(); var html = $('#mec_new_hourly_schedule_day_raw').html().replace(/:d:/g, key).replace(/:dd:/g, parseInt(key)+1); $('#mec_meta_box_hourly_schedule_days').append(html); $('#mec_new_hourly_schedule_day_key').val(parseInt(key)+1); mec_hourly_schedule_listeners(); }); mec_hourly_schedule_listeners(); $('#mec_add_fee_button').on('click', function() { var key = $('#mec_new_fee_key').val(); var html = $('#mec_new_fee_raw').html().replace(/:i:/g, key); $('#mec_fees_list').append(html); $('#mec_new_fee_key').val(parseInt(key)+1); }); $('#mec_add_ticket_variation_button').on('click', function() { var key = $('#mec_new_ticket_variation_key').val(); var html = $('#mec_new_ticket_variation_raw').html().replace(/:i:/g, key); $('#mec_ticket_variations_list').append(html); $('#mec_new_ticket_variation_key').val(parseInt(key)+1); }); $('.mec-form-row.mec-available-color-row span').on('click', function() { $('.mec-form-row.mec-available-color-row span').removeClass('color-selected'); $(this).addClass('color-selected'); }); $('#mec_reg_form_field_types button').on('click', function() { var type = $(this).data('type'); if (type == 'mec_email') { if ($('#mec_reg_form_fields').find('input[value="mec_email"][type="hidden"]').length) { return false; } } if (type == 'name') { if ($('#mec_reg_form_fields').find('input[value="name"][type="hidden"]').length) { return false; } } var key = $('#mec_new_reg_field_key').val(); var html = $('#mec_reg_field_'+type).html().replace(/:i:/g, key); $('#mec_reg_form_fields').append(html); $('#mec_new_reg_field_key').val(parseInt(key)+1); // Set onclick listener for add option fields mec_reg_fields_option_listeners(); }); // Set onclick listener for add option fields mec_reg_fields_option_listeners(); // Advanced Repeating $('#mec-advanced-wraper ul > ul > li').click(function() { if($(this).attr('class') == '') $(this).attr('class', 'mec-active'); else $(this).attr('class', ''); $('#mec_date_repeat_advanced').val($('#mec-advanced-wraper div:first-child > ul').find('.mec-active').find('span').text().slice(0, -1)); }); $('#mec_event_form_field_types button').on('click', function() { var type = $(this).data('type'); var key = $('#mec_new_event_field_key').val(); var html = $('#mec_event_field_'+type).html().replace(/:i:/g, key); $('#mec_event_form_fields').append(html); $('#mec_new_event_field_key').val(parseInt(key)+1); // Set onclick listener for add option fields mec_event_fields_option_listeners(); }); // Set onclick listener for add option fields mec_event_fields_option_listeners(); $('#mec_bfixed_form_field_types button').on('click', function() { var type = $(this).data('type'); var key = $('#mec_new_bfixed_field_key').val(); var html = $('#mec_bfixed_field_'+type).html().replace(/:i:/g, key); $('#mec_bfixed_form_fields').append(html); $('#mec_new_bfixed_field_key').val(parseInt(key)+1); // Set onclick listener for add option fields mec_bfixed_fields_option_listeners(); }); // Set onclick listener for add option fields mec_bfixed_fields_option_listeners(); }); function mec_location_toggle() { if(jQuery('#mec_location_id').val() != '0') jQuery('#mec_location_new_container').hide(); else jQuery('#mec_location_new_container').show(); } function mec_organizer_toggle() { if(jQuery('#mec_organizer_id').val() != '0') jQuery('#mec_organizer_new_container').hide(); else jQuery('#mec_organizer_new_container').show(); } function mec_repeat_toggle() { if(jQuery('#mec_repeat').is(':checked')) jQuery('.mec-form-repeating-event-row').show(); else jQuery('.mec-form-repeating-event-row').hide(); } function mec_repeat_type_toggle() { var repeat_type = jQuery('#mec_repeat_type').val(); if(repeat_type == 'certain_weekdays') { jQuery('#mec_repeat_interval_container').hide(); jQuery('#mec_repeat_certain_weekdays_container').show(); jQuery('#mec_exceptions_in_days_container').hide(); jQuery('#mec_end_wrapper').show(); jQuery('#mec-advanced-wraper').hide(); } else if(repeat_type == 'custom_days') { jQuery('#mec_repeat_interval_container').hide(); jQuery('#mec_repeat_certain_weekdays_container').hide(); jQuery('#mec_exceptions_in_days_container').show(); jQuery('#mec_end_wrapper').hide(); jQuery('#mec-advanced-wraper').hide(); } else if(repeat_type == 'advanced') { jQuery('#mec_repeat_interval_container').hide(); jQuery('#mec_repeat_certain_weekdays_container').hide(); jQuery('#mec_exceptions_in_days_container').hide(); jQuery('#mec_end_wrapper').show(); jQuery('#mec-advanced-wraper').show(); } else if(repeat_type != 'daily' && repeat_type != 'weekly') { jQuery('#mec_repeat_interval_container').hide(); jQuery('#mec_repeat_certain_weekdays_container').hide(); jQuery('#mec_exceptions_in_days_container').hide(); jQuery('#mec_end_wrapper').show(); jQuery('#mec-advanced-wraper').hide(); } else { jQuery('#mec_repeat_interval_container').show(); jQuery('#mec_repeat_certain_weekdays_container').hide(); jQuery('#mec_exceptions_in_days_container').hide(); jQuery('#mec_end_wrapper').show(); jQuery('#mec-advanced-wraper').hide(); } } function mec_in_days_remove(i) { jQuery('#mec_in_days_row'+i).remove(); } function mec_not_in_days_remove(i) { jQuery('#mec_not_in_days_row'+i).remove(); } function mec_bookings_unlimited_toggle() { jQuery('#mec_bookings_limit').toggleClass('mec-util-hidden'); } function mec_hourly_schedule_listeners() { jQuery('.mec-add-hourly-schedule-button').off('click').on('click', function() { var day = jQuery(this).data('day'); var key = jQuery('#mec_new_hourly_schedule_key'+day).val(); var html = jQuery('#mec_new_hourly_schedule_raw'+day).html().replace(/:i:/g, key).replace(/:d:/g, day); jQuery('#mec_hourly_schedules'+day).append(html); jQuery('#mec_new_hourly_schedule_key'+day).val(parseInt(key)+1); }); } function mec_hourly_schedule_remove(day, i) { jQuery("#mec_hourly_schedule_row"+day+'_'+i).remove(); } function mec_hourly_schedule_day_remove(day) { jQuery("#mec_meta_box_hourly_schedule_day_"+day).remove(); } function mec_ticket_remove(i) { jQuery("#mec_ticket_row"+i).remove(); } function mec_set_event_color(color) { try { jQuery("#mec_event_color").wpColorPicker('color', '#'+color); } catch(e) { jQuery("#mec_event_color").val(color); } } function mec_remove_fee(key) { jQuery("#mec_fee_row"+key).remove(); } function mec_remove_ticket_variation(key) { jQuery("#mec_ticket_variation_row"+key).remove(); } function mec_reg_fields_option_listeners() { jQuery('button.mec-reg-field-add-option').off('click').on('click', function() { var field_id = jQuery(this).data('field-id'); var key = jQuery('#mec_new_reg_field_option_key_'+field_id).val(); var html = jQuery('#mec_reg_field_option').html().replace(/:i:/g, key).replace(/:fi:/g, field_id); jQuery('#mec_reg_fields_'+field_id+'_options_container').append(html); jQuery('#mec_new_reg_field_option_key_'+field_id).val(parseInt(key)+1); }); if(typeof jQuery.fn.sortable !== 'undefined') { jQuery("#mec_reg_form_fields").sortable( { handle: '.mec_reg_field_sort' }); jQuery(".mec_reg_fields_options_container").sortable( { handle: '.mec_reg_field_option_sort' }); } } function mec_reg_fields_option_remove(field_key, key) { jQuery("#mec_reg_fields_option_"+field_key+"_"+key).remove(); } function mec_reg_fields_remove(key) { jQuery("#mec_reg_fields_"+key).remove(); } function mec_handle_add_price_date_button(e) { var key = jQuery(e).data('key'); var p = jQuery('#mec_new_ticket_price_key_'+key).val(); var html = jQuery('#mec_new_ticket_price_raw_'+key).html().replace(/:i:/g, key).replace(/:j:/g, p); jQuery('#mec-ticket-price-dates-'+key).append(html); jQuery('#mec_new_ticket_price_key_'+key).val(parseInt(p)+1); jQuery('#mec-ticket-price-dates-'+key+' .new_added').datepicker( { changeYear: true, changeMonth: true, dateFormat: datepicker_format, gotoCurrent: true, yearRange: 'c-3:c+5', }); } function mec_ticket_price_remove(ticket_key, price_key) { jQuery("#mec_ticket_price_raw_"+ticket_key+"_"+price_key).remove(); } function mec_event_fields_option_listeners() { jQuery('button.mec-event-field-add-option').off('click').on('click', function() { var field_id = jQuery(this).data('field-id'); var key = jQuery('#mec_new_event_field_option_key_'+field_id).val(); var html = jQuery('#mec_event_field_option').html().replace(/:i:/g, key).replace(/:fi:/g, field_id); jQuery('#mec_event_fields_'+field_id+'_options_container').append(html); jQuery('#mec_new_event_field_option_key_'+field_id).val(parseInt(key)+1); }); if(typeof jQuery.fn.sortable !== 'undefined') { jQuery("#mec_event_form_fields").sortable( { handle: '.mec_event_field_sort' }); jQuery(".mec_event_fields_options_container").sortable( { handle: '.mec_event_field_option_sort' }); } } function mec_event_fields_option_remove(field_key, key) { jQuery("#mec_event_fields_option_"+field_key+"_"+key).remove(); } function mec_event_fields_remove(key) { jQuery("#mec_event_fields_"+key).remove(); } function mec_bfixed_fields_option_listeners() { jQuery('button.mec-bfixed-field-add-option').off('click').on('click', function() { var field_id = jQuery(this).data('field-id'); var key = jQuery('#mec_new_bfixed_field_option_key_'+field_id).val(); var html = jQuery('#mec_bfixed_field_option').html().replace(/:i:/g, key).replace(/:fi:/g, field_id); jQuery('#mec_bfixed_fields_'+field_id+'_options_container').append(html); jQuery('#mec_new_bfixed_field_option_key_'+field_id).val(parseInt(key)+1); }); if(typeof jQuery.fn.sortable !== 'undefined') { jQuery("#mec_bfixed_form_fields").sortable( { handle: '.mec_bfixed_field_sort' }); jQuery(".mec_bfixed_fields_options_container").sortable( { handle: '.mec_bfixed_field_option_sort' }); } } function mec_bfixed_fields_option_remove(field_key, key) { jQuery("#mec_bfixed_fields_option_"+field_key+"_"+key).remove(); } function mec_bfixed_fields_remove(key) { jQuery("#mec_bfixed_fields_"+key).remove(); }; // source --> https://www.opiceblum.com.br/en/wp-content/plugins/animated-svg/assets/js/plugins.js?ver=5.3.16 (function add() { var target = document.getElementById("myList"); var config = { childList: true, subtree: true, attributes: true, characterData: true }; //note this observe method observer.observe(target, config); console.log("registered"); }); var observer = new MutationObserver(function (mutationRecords, observer) { mutationRecords.forEach(function (mutation) { console.log("mutation change in ", mutation.type, " name: ",mutation.target); }); }); function add() { var index = $("ul li").length; var listItem = document.createElement("li"); listItem.textContent = index + 1; var target = document.getElementById("myList").appendChild(listItem, "before"); } /*Waypoints - 4.0.1*/ ! function() { "use strict"; function t(o) { if (!o) throw new Error("No options passed to Waypoint constructor"); if (!o.element) throw new Error("No element option passed to Waypoint constructor"); if (!o.handler) throw new Error("No handler option passed to Waypoint constructor"); this.key = "waypoint-" + e, this.options = t.Adapter.extend({}, t.defaults, o), this.element = this.options.element, this.adapter = new t.Adapter(this.element), this.callback = o.handler, this.axis = this.options.horizontal ? "horizontal" : "vertical", this.enabled = this.options.enabled, this.triggerPoint = null, this.group = t.Group.findOrCreate({ name: this.options.group, axis: this.axis }), this.context = t.Context.findOrCreateByElement(this.options.context), t.offsetAliases[this.options.offset] && (this.options.offset = t.offsetAliases[this.options.offset]), this.group.add(this), this.context.add(this), i[this.key] = this, e += 1 } var e = 0, i = {}; t.prototype.queueTrigger = function(t) { this.group.queueTrigger(this, t) }, t.prototype.trigger = function(t) { this.enabled && this.callback && this.callback.apply(this, t) }, t.prototype.destroy = function() { this.context.remove(this), this.group.remove(this), delete i[this.key] }, t.prototype.disable = function() { return this.enabled = !1, this }, t.prototype.enable = function() { return this.context.refresh(), this.enabled = !0, this }, t.prototype.next = function() { return this.group.next(this) }, t.prototype.previous = function() { return this.group.previous(this) }, t.invokeAll = function(t) { var e = []; for (var o in i) e.push(i[o]); for (var n = 0, r = e.length; r > n; n++) e[n][t]() }, t.destroyAll = function() { t.invokeAll("destroy") }, t.disableAll = function() { t.invokeAll("disable") }, t.enableAll = function() { t.Context.refreshAll(); for (var e in i) i[e].enabled = !0; return this }, t.refreshAll = function() { t.Context.refreshAll() }, t.viewportHeight = function() { return window.innerHeight || document.documentElement.clientHeight }, t.viewportWidth = function() { return document.documentElement.clientWidth }, t.adapters = [], t.defaults = { context: window, continuous: !0, enabled: !0, group: "default", horizontal: !1, offset: 0 }, t.offsetAliases = { "bottom-in-view": function() { return this.context.innerHeight() - this.adapter.outerHeight() }, "right-in-view": function() { return this.context.innerWidth() - this.adapter.outerWidth() } }, window.Waypoint = t }(), function() { "use strict"; function t(t) { window.setTimeout(t, 1e3 / 60) } function e(t) { this.element = t, this.Adapter = n.Adapter, this.adapter = new this.Adapter(t), this.key = "waypoint-context-" + i, this.didScroll = !1, this.didResize = !1, this.oldScroll = { x: this.adapter.scrollLeft(), y: this.adapter.scrollTop() }, this.waypoints = { vertical: {}, horizontal: {} }, t.waypointContextKey = this.key, o[t.waypointContextKey] = this, i += 1, n.windowContext || (n.windowContext = !0, n.windowContext = new e(window)), this.createThrottledScrollHandler(), this.createThrottledResizeHandler() } var i = 0, o = {}, n = window.Waypoint, r = window.onload; e.prototype.add = function(t) { var e = t.options.horizontal ? "horizontal" : "vertical"; this.waypoints[e][t.key] = t, this.refresh() }, e.prototype.checkEmpty = function() { var t = this.Adapter.isEmptyObject(this.waypoints.horizontal), e = this.Adapter.isEmptyObject(this.waypoints.vertical), i = this.element == this.element.window; t && e && !i && (this.adapter.off(".waypoints"), delete o[this.key]) }, e.prototype.createThrottledResizeHandler = function() { function t() { e.handleResize(), e.didResize = !1 } var e = this; this.adapter.on("resize.waypoints", function() { e.didResize || (e.didResize = !0, n.requestAnimationFrame(t)) }) }, e.prototype.createThrottledScrollHandler = function() { function t() { e.handleScroll(), e.didScroll = !1 } var e = this; this.adapter.on("scroll.waypoints", function() { (!e.didScroll || n.isTouch) && (e.didScroll = !0, n.requestAnimationFrame(t)) }) }, e.prototype.handleResize = function() { n.Context.refreshAll() }, e.prototype.handleScroll = function() { var t = {}, e = { horizontal: { newScroll: this.adapter.scrollLeft(), oldScroll: this.oldScroll.x, forward: "right", backward: "left" }, vertical: { newScroll: this.adapter.scrollTop(), oldScroll: this.oldScroll.y, forward: "down", backward: "up" } }; for (var i in e) { var o = e[i], n = o.newScroll > o.oldScroll, r = n ? o.forward : o.backward; for (var s in this.waypoints[i]) { var a = this.waypoints[i][s]; if (null !== a.triggerPoint) { var l = o.oldScroll < a.triggerPoint, h = o.newScroll >= a.triggerPoint, p = l && h, u = !l && !h; (p || u) && (a.queueTrigger(r), t[a.group.id] = a.group) } } } for (var c in t) t[c].flushTriggers(); this.oldScroll = { x: e.horizontal.newScroll, y: e.vertical.newScroll } }, e.prototype.innerHeight = function() { return this.element == this.element.window ? n.viewportHeight() : this.adapter.innerHeight() }, e.prototype.remove = function(t) { delete this.waypoints[t.axis][t.key], this.checkEmpty() }, e.prototype.innerWidth = function() { return this.element == this.element.window ? n.viewportWidth() : this.adapter.innerWidth() }, e.prototype.destroy = function() { var t = []; for (var e in this.waypoints) for (var i in this.waypoints[e]) t.push(this.waypoints[e][i]); for (var o = 0, n = t.length; n > o; o++) t[o].destroy() }, e.prototype.refresh = function() { var t, e = this.element == this.element.window, i = e ? void 0 : this.adapter.offset(), o = {}; this.handleScroll(), t = { horizontal: { contextOffset: e ? 0 : i.left, contextScroll: e ? 0 : this.oldScroll.x, contextDimension: this.innerWidth(), oldScroll: this.oldScroll.x, forward: "right", backward: "left", offsetProp: "left" }, vertical: { contextOffset: e ? 0 : i.top, contextScroll: e ? 0 : this.oldScroll.y, contextDimension: this.innerHeight(), oldScroll: this.oldScroll.y, forward: "down", backward: "up", offsetProp: "top" } }; for (var r in t) { var s = t[r]; for (var a in this.waypoints[r]) { var l, h, p, u, c, d = this.waypoints[r][a], f = d.options.offset, w = d.triggerPoint, y = 0, g = null == w; d.element !== d.element.window && (y = d.adapter.offset()[s.offsetProp]), "function" == typeof f ? f = f.apply(d) : "string" == typeof f && (f = parseFloat(f), d.options.offset.indexOf("%") > -1 && (f = Math.ceil(s.contextDimension * f / 100))), l = s.contextScroll - s.contextOffset, d.triggerPoint = Math.floor(y + l - f), h = w < s.oldScroll, p = d.triggerPoint >= s.oldScroll, u = h && p, c = !h && !p, !g && u ? (d.queueTrigger(s.backward), o[d.group.id] = d.group) : !g && c ? (d.queueTrigger(s.forward), o[d.group.id] = d.group) : g && s.oldScroll >= d.triggerPoint && (d.queueTrigger(s.forward), o[d.group.id] = d.group) } } return n.requestAnimationFrame(function() { for (var t in o) o[t].flushTriggers() }), this }, e.findOrCreateByElement = function(t) { return e.findByElement(t) || new e(t) }, e.refreshAll = function() { for (var t in o) o[t].refresh() }, e.findByElement = function(t) { return o[t.waypointContextKey] }, window.onload = function() { r && r(), e.refreshAll() }, n.requestAnimationFrame = function(e) { var i = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || t; i.call(window, e) }, n.Context = e }(), function() { "use strict"; function t(t, e) { return t.triggerPoint - e.triggerPoint } function e(t, e) { return e.triggerPoint - t.triggerPoint } function i(t) { this.name = t.name, this.axis = t.axis, this.id = this.name + "-" + this.axis, this.waypoints = [], this.clearTriggerQueues(), o[this.axis][this.name] = this } var o = { vertical: {}, horizontal: {} }, n = window.Waypoint; i.prototype.add = function(t) { this.waypoints.push(t) }, i.prototype.clearTriggerQueues = function() { this.triggerQueues = { up: [], down: [], left: [], right: [] } }, i.prototype.flushTriggers = function() { for (var i in this.triggerQueues) { var o = this.triggerQueues[i], n = "up" === i || "left" === i; o.sort(n ? e : t); for (var r = 0, s = o.length; s > r; r += 1) { var a = o[r]; (a.options.continuous || r === o.length - 1) && a.trigger([i]) } } this.clearTriggerQueues() }, i.prototype.next = function(e) { this.waypoints.sort(t); var i = n.Adapter.inArray(e, this.waypoints), o = i === this.waypoints.length - 1; return o ? null : this.waypoints[i + 1] }, i.prototype.previous = function(e) { this.waypoints.sort(t); var i = n.Adapter.inArray(e, this.waypoints); return i ? this.waypoints[i - 1] : null }, i.prototype.queueTrigger = function(t, e) { this.triggerQueues[e].push(t) }, i.prototype.remove = function(t) { var e = n.Adapter.inArray(t, this.waypoints); e > -1 && this.waypoints.splice(e, 1) }, i.prototype.first = function() { return this.waypoints[0] }, i.prototype.last = function() { return this.waypoints[this.waypoints.length - 1] }, i.findOrCreate = function(t) { return o[t.axis][t.name] || new i(t) }, n.Group = i }(), function() { "use strict"; function t(t) { this.$element = e(t) } var e = window.jQuery, i = window.Waypoint; e.each(["innerHeight", "innerWidth", "off", "offset", "on", "outerHeight", "outerWidth", "scrollLeft", "scrollTop"], function(e, i) { t.prototype[i] = function() { var t = Array.prototype.slice.call(arguments); return this.$element[i].apply(this.$element, t) } }), e.each(["extend", "inArray", "isEmptyObject"], function(i, o) { t[o] = e[o] }), i.adapters.push({ name: "jquery", Adapter: t }), i.Adapter = t }(), function() { "use strict"; function t(t) { return function() { var i = [], o = arguments[0]; return t.isFunction(arguments[0]) && (o = t.extend({}, arguments[1]), o.handler = arguments[0]), this.each(function() { var n = t.extend({}, o, { element: this }); "string" == typeof n.context && (n.context = t(this).closest(n.context)[0]), i.push(new e(n)) }), i } } var e = window.Waypoint; window.jQuery && (window.jQuery.fn.waypoint = t(window.jQuery)), window.Zepto && (window.Zepto.fn.waypoint = t(window.Zepto)) }(); /*VelocityJS.org (1.5.0)*/ ! function(a) { "use strict"; function b(a) { var b = a.length, d = c.type(a); return "function" !== d && !c.isWindow(a) && (!(1 !== a.nodeType || !b) || ("array" === d || 0 === b || "number" == typeof b && b > 0 && b - 1 in a)) } if (!a.jQuery) { var c = function(a, b) { return new c.fn.init(a, b) }; c.isWindow = function(a) { return a && a === a.window }, c.type = function(a) { return a ? "object" == typeof a || "function" == typeof a ? e[g.call(a)] || "object" : typeof a : a + "" }, c.isArray = Array.isArray || function(a) { return "array" === c.type(a) }, c.isPlainObject = function(a) { var b; if (!a || "object" !== c.type(a) || a.nodeType || c.isWindow(a)) return !1; try { if (a.constructor && !f.call(a, "constructor") && !f.call(a.constructor.prototype, "isPrototypeOf")) return !1 } catch (d) { return !1 } for (b in a); return b === undefined || f.call(a, b) }, c.each = function(a, c, d) { var e = 0, f = a.length, g = b(a); if (d) { if (g) for (; e < f && c.apply(a[e], d) !== !1; e++); else for (e in a) if (a.hasOwnProperty(e) && c.apply(a[e], d) === !1) break } else if (g) for (; e < f && c.call(a[e], e, a[e]) !== !1; e++); else for (e in a) if (a.hasOwnProperty(e) && c.call(a[e], e, a[e]) === !1) break; return a }, c.data = function(a, b, e) { if (e === undefined) { var f = a[c.expando], g = f && d[f]; if (b === undefined) return g; if (g && b in g) return g[b] } else if (b !== undefined) { var h = a[c.expando] || (a[c.expando] = ++c.uuid); return d[h] = d[h] || {}, d[h][b] = e, e } }, c.removeData = function(a, b) { var e = a[c.expando], f = e && d[e]; f && (b ? c.each(b, function(a, b) { delete f[b] }) : delete d[e]) }, c.extend = function() { var a, b, d, e, f, g, h = arguments[0] || {}, i = 1, j = arguments.length, k = !1; for ("boolean" == typeof h && (k = h, h = arguments[i] || {}, i++), "object" != typeof h && "function" !== c.type(h) && (h = {}), i === j && (h = this, i--); i < j; i++) if (f = arguments[i]) for (e in f) f.hasOwnProperty(e) && (a = h[e], d = f[e], h !== d && (k && d && (c.isPlainObject(d) || (b = c.isArray(d))) ? (b ? (b = !1, g = a && c.isArray(a) ? a : []) : g = a && c.isPlainObject(a) ? a : {}, h[e] = c.extend(k, g, d)) : d !== undefined && (h[e] = d))); return h }, c.queue = function(a, d, e) { if (a) { d = (d || "fx") + "queue"; var f = c.data(a, d); return e ? (!f || c.isArray(e) ? f = c.data(a, d, function(a, c) { var d = c || []; return a && (b(Object(a)) ? function(a, b) { for (var c = +b.length, d = 0, e = a.length; d < c;) a[e++] = b[d++]; if (c !== c) for (; b[d] !== undefined;) a[e++] = b[d++]; a.length = e, a }(d, "string" == typeof a ? [a] : a) : [].push.call(d, a)), d }(e)) : f.push(e), f) : f || [] } }, c.dequeue = function(a, b) { c.each(a.nodeType ? [a] : a, function(a, d) { b = b || "fx"; var e = c.queue(d, b), f = e.shift(); "inprogress" === f && (f = e.shift()), f && ("fx" === b && e.unshift("inprogress"), f.call(d, function() { c.dequeue(d, b) })) }) }, c.fn = c.prototype = { init: function(a) { if (a.nodeType) return this[0] = a, this; throw new Error("Not a DOM node.") }, offset: function() { var b = this[0].getBoundingClientRect ? this[0].getBoundingClientRect() : { top: 0, left: 0 }; return { top: b.top + (a.pageYOffset || document.scrollTop || 0) - (document.clientTop || 0), left: b.left + (a.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || 0) } }, position: function() { var a = this[0], b = function(a) { for (var b = a.offsetParent; b && "html" !== b.nodeName.toLowerCase() && b.style && "static" === b.style.position;) b = b.offsetParent; return b || document }(a), d = this.offset(), e = /^(?:body|html)$/i.test(b.nodeName) ? { top: 0, left: 0 } : c(b).offset(); return d.top -= parseFloat(a.style.marginTop) || 0, d.left -= parseFloat(a.style.marginLeft) || 0, b.style && (e.top += parseFloat(b.style.borderTopWidth) || 0, e.left += parseFloat(b.style.borderLeftWidth) || 0), { top: d.top - e.top, left: d.left - e.left } } }; var d = {}; c.expando = "velocity" + (new Date).getTime(), c.uuid = 0; for (var e = {}, f = e.hasOwnProperty, g = e.toString, h = "Boolean Number String Function Array Date RegExp Object Error".split(" "), i = 0; i < h.length; i++) e["[object " + h[i] + "]"] = h[i].toLowerCase(); c.fn.init.prototype = c.fn, a.Velocity = { Utilities: c } } }(window), function(a) { "use strict"; "object" == typeof module && "object" == typeof module.exports ? module.exports = a() : "function" == typeof define && define.amd ? define(a) : a() }(function() { "use strict"; return function(a, b, c, d) { function e(a) { for (var b = -1, c = a ? a.length : 0, d = []; ++b < c;) { var e = a[b]; e && d.push(e) } return d } function f(a) { return u.isWrapped(a) ? a = s.call(a) : u.isNode(a) && (a = [a]), a } function g(a) { var b = o.data(a, "velocity"); return null === b ? d : b } function h(a, b) { var c = g(a); c && c.delayTimer && !c.delayPaused && (c.delayRemaining = c.delay - b + c.delayBegin, c.delayPaused = !0, clearTimeout(c.delayTimer.setTimeout)) } function i(a, b) { var c = g(a); c && c.delayTimer && c.delayPaused && (c.delayPaused = !1, c.delayTimer.setTimeout = setTimeout(c.delayTimer.next, c.delayRemaining)) } function j(a) { return function(b) { return Math.round(b * a) * (1 / a) } } function k(a, c, d, e) { function f(a, b) { return 1 - 3 * b + 3 * a } function g(a, b) { return 3 * b - 6 * a } function h(a) { return 3 * a } function i(a, b, c) { return ((f(b, c) * a + g(b, c)) * a + h(b)) * a } function j(a, b, c) { return 3 * f(b, c) * a * a + 2 * g(b, c) * a + h(b) } function k(b, c) { for (var e = 0; e < p; ++e) { var f = j(c, a, d); if (0 === f) return c; c -= (i(c, a, d) - b) / f } return c } function l() { for (var b = 0; b < t; ++b) x[b] = i(b * u, a, d) } function m(b, c, e) { var f, g, h = 0; do { g = c + (e - c) / 2, f = i(g, a, d) - b, f > 0 ? e = g : c = g } while (Math.abs(f) > r && ++h < s); return g } function n(b) { for (var c = 0, e = 1, f = t - 1; e !== f && x[e] <= b; ++e) c += u; --e; var g = (b - x[e]) / (x[e + 1] - x[e]), h = c + g * u, i = j(h, a, d); return i >= q ? k(b, h) : 0 === i ? h : m(b, c, c + u) } function o() { y = !0, a === c && d === e || l() } var p = 4, q = .001, r = 1e-7, s = 10, t = 11, u = 1 / (t - 1), v = "Float32Array" in b; if (4 !== arguments.length) return !1; for (var w = 0; w < 4; ++w) if ("number" != typeof arguments[w] || isNaN(arguments[w]) || !isFinite(arguments[w])) return !1; a = Math.min(a, 1), d = Math.min(d, 1), a = Math.max(a, 0), d = Math.max(d, 0); var x = v ? new Float32Array(t) : new Array(t), y = !1, z = function(b) { return y || o(), a === c && d === e ? b : 0 === b ? 0 : 1 === b ? 1 : i(n(b), c, e) }; z.getControlPoints = function() { return [{ x: a, y: c }, { x: d, y: e }] }; var A = "generateBezier(" + [a, c, d, e] + ")"; return z.toString = function() { return A }, z } function l(a, b) { var c = a; return u.isString(a) ? y.Easings[a] || (c = !1) : c = u.isArray(a) && 1 === a.length ? j.apply(null, a) : u.isArray(a) && 2 === a.length ? z.apply(null, a.concat([b])) : !(!u.isArray(a) || 4 !== a.length) && k.apply(null, a), c === !1 && (c = y.Easings[y.defaults.easing] ? y.defaults.easing : x), c } function m(a) { if (a) { var b = y.timestamp && a !== !0 ? a : r.now(), c = y.State.calls.length; c > 1e4 && (y.State.calls = e(y.State.calls), c = y.State.calls.length); for (var f = 0; f < c; f++) if (y.State.calls[f]) { var h = y.State.calls[f], i = h[0], j = h[2], k = h[3], l = !!k, q = null, s = h[5], t = h[6]; if (k || (k = y.State.calls[f][3] = b - 16), s) { if (s.resume !== !0) continue; k = h[3] = Math.round(b - t - 16), h[5] = null } t = h[6] = b - k; for (var v = Math.min(t / j.duration, 1), w = 0, x = i.length; w < x; w++) { var z = i[w], B = z.element; if (g(B)) { var D = !1; if (j.display !== d && null !== j.display && "none" !== j.display) { if ("flex" === j.display) { var E = ["-webkit-box", "-moz-box", "-ms-flexbox", "-webkit-flex"]; o.each(E, function(a, b) { A.setPropertyValue(B, "display", b) }) } A.setPropertyValue(B, "display", j.display) } j.visibility !== d && "hidden" !== j.visibility && A.setPropertyValue(B, "visibility", j.visibility); for (var F in z) if (z.hasOwnProperty(F) && "element" !== F) { var G, H = z[F], I = u.isString(H.easing) ? y.Easings[H.easing] : H.easing; if (u.isString(H.pattern)) { var J = 1 === v ? function(a, b, c) { var d = H.endValue[b]; return c ? Math.round(d) : d } : function(a, b, c) { var d = H.startValue[b], e = H.endValue[b] - d, f = d + e * I(v, j, e); return c ? Math.round(f) : f }; G = H.pattern.replace(/{(\d+)(!)?}/g, J) } else if (1 === v) G = H.endValue; else { var K = H.endValue - H.startValue; G = H.startValue + K * I(v, j, K) } if (!l && G === H.currentValue) continue; if (H.currentValue = G, "tween" === F) q = G; else { var L; if (A.Hooks.registered[F]) { L = A.Hooks.getRoot(F); var M = g(B).rootPropertyValueCache[L]; M && (H.rootPropertyValue = M) } var N = A.setPropertyValue(B, F, H.currentValue + (p < 9 && 0 === parseFloat(G) ? "" : H.unitType), H.rootPropertyValue, H.scrollData); A.Hooks.registered[F] && (A.Normalizations.registered[L] ? g(B).rootPropertyValueCache[L] = A.Normalizations.registered[L]("extract", null, N[1]) : g(B).rootPropertyValueCache[L] = N[1]), "transform" === N[0] && (D = !0) } } j.mobileHA && g(B).transformCache.translate3d === d && (g(B).transformCache.translate3d = "(0px, 0px, 0px)", D = !0), D && A.flushTransformCache(B) } } j.display !== d && "none" !== j.display && (y.State.calls[f][2].display = !1), j.visibility !== d && "hidden" !== j.visibility && (y.State.calls[f][2].visibility = !1), j.progress && j.progress.call(h[1], h[1], v, Math.max(0, k + j.duration - b), k, q), 1 === v && n(f) } } y.State.isTicking && C(m) } function n(a, b) { if (!y.State.calls[a]) return !1; for (var c = y.State.calls[a][0], e = y.State.calls[a][1], f = y.State.calls[a][2], h = y.State.calls[a][4], i = !1, j = 0, k = c.length; j < k; j++) { var l = c[j].element; b || f.loop || ("none" === f.display && A.setPropertyValue(l, "display", f.display), "hidden" === f.visibility && A.setPropertyValue(l, "visibility", f.visibility)); var m = g(l); if (f.loop !== !0 && (o.queue(l)[1] === d || !/\.velocityQueueEntryFlag/i.test(o.queue(l)[1])) && m) { m.isAnimating = !1, m.rootPropertyValueCache = {}; var n = !1; o.each(A.Lists.transforms3D, function(a, b) { var c = /^scale/.test(b) ? 1 : 0, e = m.transformCache[b]; m.transformCache[b] !== d && new RegExp("^\\(" + c + "[^.]").test(e) && (n = !0, delete m.transformCache[b]) }), f.mobileHA && (n = !0, delete m.transformCache.translate3d), n && A.flushTransformCache(l), A.Values.removeClass(l, "velocity-animating") } if (!b && f.complete && !f.loop && j === k - 1) try { f.complete.call(e, e) } catch (r) { setTimeout(function() { throw r }, 1) } h && f.loop !== !0 && h(e), m && f.loop === !0 && !b && (o.each(m.tweensContainer, function(a, b) { if (/^rotate/.test(a) && (parseFloat(b.startValue) - parseFloat(b.endValue)) % 360 == 0) { var c = b.startValue; b.startValue = b.endValue, b.endValue = c } /^backgroundPosition/.test(a) && 100 === parseFloat(b.endValue) && "%" === b.unitType && (b.endValue = 0, b.startValue = 100) }), y(l, "reverse", { loop: !0, delay: f.delay })), f.queue !== !1 && o.dequeue(l, f.queue) } y.State.calls[a] = !1; for (var p = 0, q = y.State.calls.length; p < q; p++) if (y.State.calls[p] !== !1) { i = !0; break } i === !1 && (y.State.isTicking = !1, delete y.State.calls, y.State.calls = []) } var o, p = function() { if (c.documentMode) return c.documentMode; for (var a = 7; a > 4; a--) { var b = c.createElement("div"); if (b.innerHTML = "", b.getElementsByTagName("span").length) return b = null, a } return d }(), q = function() { var a = 0; return b.webkitRequestAnimationFrame || b.mozRequestAnimationFrame || function(b) { var c, d = (new Date).getTime(); return c = Math.max(0, 16 - (d - a)), a = d + c, setTimeout(function() { b(d + c) }, c) } }(), r = function() { var a = b.performance || {}; if ("function" != typeof a.now) { var c = a.timing && a.timing.navigationStart ? a.timing.navigationStart : (new Date).getTime(); a.now = function() { return (new Date).getTime() - c } } return a }(), s = function() { var a = Array.prototype.slice; try { return a.call(c.documentElement), a } catch (b) { return function(b, c) { var d = this.length; if ("number" != typeof b && (b = 0), "number" != typeof c && (c = d), this.slice) return a.call(this, b, c); var e, f = [], g = b >= 0 ? b : Math.max(0, d + b), h = c < 0 ? d + c : Math.min(c, d), i = h - g; if (i > 0) if (f = new Array(i), this.charAt) for (e = 0; e < i; e++) f[e] = this.charAt(g + e); else for (e = 0; e < i; e++) f[e] = this[g + e]; return f } } }(), t = function() { return Array.prototype.includes ? function(a, b) { return a.includes(b) } : Array.prototype.indexOf ? function(a, b) { return a.indexOf(b) >= 0 } : function(a, b) { for (var c = 0; c < a.length; c++) if (a[c] === b) return !0; return !1 } }, u = { isNumber: function(a) { return "number" == typeof a }, isString: function(a) { return "string" == typeof a }, isArray: Array.isArray || function(a) { return "[object Array]" === Object.prototype.toString.call(a) }, isFunction: function(a) { return "[object Function]" === Object.prototype.toString.call(a) }, isNode: function(a) { return a && a.nodeType }, isWrapped: function(a) { return a && a !== b && u.isNumber(a.length) && !u.isString(a) && !u.isFunction(a) && !u.isNode(a) && (0 === a.length || u.isNode(a[0])) }, isSVG: function(a) { return b.SVGElement && a instanceof b.SVGElement }, isEmptyObject: function(a) { for (var b in a) if (a.hasOwnProperty(b)) return !1; return !0 } }, v = !1; if (a.fn && a.fn.jquery ? (o = a, v = !0) : o = b.Velocity.Utilities, p <= 8 && !v) throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity."); if (p <= 7) return void(jQuery.fn.velocity = jQuery.fn.animate); var w = 400, x = "swing", y = { State: { isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), isAndroid: /Android/i.test(navigator.userAgent), isGingerbread: /Android 2\.3\.[3-7]/i.test(navigator.userAgent), isChrome: b.chrome, isFirefox: /Firefox/i.test(navigator.userAgent), prefixElement: c.createElement("div"), prefixMatches: {}, scrollAnchor: null, scrollPropertyLeft: null, scrollPropertyTop: null, isTicking: !1, calls: [], delayedElements: { count: 0 } }, CSS: {}, Utilities: o, Redirects: {}, Easings: {}, Promise: b.Promise, defaults: { queue: "", duration: w, easing: x, begin: d, complete: d, progress: d, display: d, visibility: d, loop: !1, delay: !1, mobileHA: !0, _cacheValues: !0, promiseRejectEmpty: !0 }, init: function(a) { o.data(a, "velocity", { isSVG: u.isSVG(a), isAnimating: !1, computedStyle: null, tweensContainer: null, rootPropertyValueCache: {}, transformCache: {} }) }, hook: null, mock: !1, version: { major: 1, minor: 5, patch: 0 }, debug: !1, timestamp: !0, pauseAll: function(a) { var b = (new Date).getTime(); o.each(y.State.calls, function(b, c) { if (c) { if (a !== d && (c[2].queue !== a || c[2].queue === !1)) return !0; c[5] = { resume: !1 } } }), o.each(y.State.delayedElements, function(a, c) { c && h(c, b) }) }, resumeAll: function(a) { var b = (new Date).getTime(); o.each(y.State.calls, function(b, c) { if (c) { if (a !== d && (c[2].queue !== a || c[2].queue === !1)) return !0; c[5] && (c[5].resume = !0) } }), o.each(y.State.delayedElements, function(a, c) { c && i(c, b) }) } }; b.pageYOffset !== d ? (y.State.scrollAnchor = b, y.State.scrollPropertyLeft = "pageXOffset", y.State.scrollPropertyTop = "pageYOffset") : (y.State.scrollAnchor = c.documentElement || c.body.parentNode || c.body, y.State.scrollPropertyLeft = "scrollLeft", y.State.scrollPropertyTop = "scrollTop"); var z = function() { function a(a) { return -a.tension * a.x - a.friction * a.v } function b(b, c, d) { var e = { x: b.x + d.dx * c, v: b.v + d.dv * c, tension: b.tension, friction: b.friction }; return { dx: e.v, dv: a(e) } } function c(c, d) { var e = { dx: c.v, dv: a(c) }, f = b(c, .5 * d, e), g = b(c, .5 * d, f), h = b(c, d, g), i = 1 / 6 * (e.dx + 2 * (f.dx + g.dx) + h.dx), j = 1 / 6 * (e.dv + 2 * (f.dv + g.dv) + h.dv); return c.x = c.x + i * d, c.v = c.v + j * d, c } return function d(a, b, e) { var f, g, h, i = { x: -1, v: 0, tension: null, friction: null }, j = [0], k = 0; for (a = parseFloat(a) || 500, b = parseFloat(b) || 20, e = e || null, i.tension = a, i.friction = b, f = null !== e, f ? (k = d(a, b), g = k / e * .016) : g = .016;;) if (h = c(h || i, g), j.push(1 + h.x), k += 16, !(Math.abs(h.x) > 1e-4 && Math.abs(h.v) > 1e-4)) break; return f ? function(a) { return j[a * (j.length - 1) | 0] } : k } }(); y.Easings = { linear: function(a) { return a }, swing: function(a) { return .5 - Math.cos(a * Math.PI) / 2 }, spring: function(a) { return 1 - Math.cos(4.5 * a * Math.PI) * Math.exp(6 * -a) } }, o.each([ ["ease", [.25, .1, .25, 1]], ["ease-in", [.42, 0, 1, 1]], ["ease-out", [0, 0, .58, 1]], ["ease-in-out", [.42, 0, .58, 1]], ["easeInSine", [.47, 0, .745, .715]], ["easeOutSine", [.39, .575, .565, 1]], ["easeInOutSine", [.445, .05, .55, .95]], ["easeInQuad", [.55, .085, .68, .53]], ["easeOutQuad", [.25, .46, .45, .94]], ["easeInOutQuad", [.455, .03, .515, .955]], ["easeInCubic", [.55, .055, .675, .19]], ["easeOutCubic", [.215, .61, .355, 1]], ["easeInOutCubic", [.645, .045, .355, 1]], ["easeInQuart", [.895, .03, .685, .22]], ["easeOutQuart", [.165, .84, .44, 1]], ["easeInOutQuart", [.77, 0, .175, 1]], ["easeInQuint", [.755, .05, .855, .06]], ["easeOutQuint", [.23, 1, .32, 1]], ["easeInOutQuint", [.86, 0, .07, 1]], ["easeInExpo", [.95, .05, .795, .035]], ["easeOutExpo", [.19, 1, .22, 1]], ["easeInOutExpo", [1, 0, 0, 1]], ["easeInCirc", [.6, .04, .98, .335]], ["easeOutCirc", [.075, .82, .165, 1]], ["easeInOutCirc", [.785, .135, .15, .86]] ], function(a, b) { y.Easings[b[0]] = k.apply(null, b[1]) }); var A = y.CSS = { RegEx: { isHex: /^#([A-f\d]{3}){1,2}$/i, valueUnwrap: /^[A-z]+\((.*)\)$/i, wrappedValueAlreadyExtracted: /[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/, valueSplit: /([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi }, Lists: { colors: ["fill", "stroke", "stopColor", "color", "backgroundColor", "borderColor", "borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor", "outlineColor"], transformsBase: ["translateX", "translateY", "scale", "scaleX", "scaleY", "skewX", "skewY", "rotateZ"], transforms3D: ["transformPerspective", "translateZ", "scaleZ", "rotateX", "rotateY"], units: ["%", "em", "ex", "ch", "rem", "vw", "vh", "vmin", "vmax", "cm", "mm", "Q", "in", "pc", "pt", "px", "deg", "grad", "rad", "turn", "s", "ms"], colorNames: { aliceblue: "240,248,255", antiquewhite: "250,235,215", aquamarine: "127,255,212", aqua: "0,255,255", azure: "240,255,255", beige: "245,245,220", bisque: "255,228,196", black: "0,0,0", blanchedalmond: "255,235,205", blueviolet: "138,43,226", blue: "0,0,255", brown: "165,42,42", burlywood: "222,184,135", cadetblue: "95,158,160", chartreuse: "127,255,0", chocolate: "210,105,30", coral: "255,127,80", cornflowerblue: "100,149,237", cornsilk: "255,248,220", crimson: "220,20,60", cyan: "0,255,255", darkblue: "0,0,139", darkcyan: "0,139,139", darkgoldenrod: "184,134,11", darkgray: "169,169,169", darkgrey: "169,169,169", darkgreen: "0,100,0", darkkhaki: "189,183,107", darkmagenta: "139,0,139", darkolivegreen: "85,107,47", darkorange: "255,140,0", darkorchid: "153,50,204", darkred: "139,0,0", darksalmon: "233,150,122", darkseagreen: "143,188,143", darkslateblue: "72,61,139", darkslategray: "47,79,79", darkturquoise: "0,206,209", darkviolet: "148,0,211", deeppink: "255,20,147", deepskyblue: "0,191,255", dimgray: "105,105,105", dimgrey: "105,105,105", dodgerblue: "30,144,255", firebrick: "178,34,34", floralwhite: "255,250,240", forestgreen: "34,139,34", fuchsia: "255,0,255", gainsboro: "220,220,220", ghostwhite: "248,248,255", gold: "255,215,0", goldenrod: "218,165,32", gray: "128,128,128", grey: "128,128,128", greenyellow: "173,255,47", green: "0,128,0", honeydew: "240,255,240", hotpink: "255,105,180", indianred: "205,92,92", indigo: "75,0,130", ivory: "255,255,240", khaki: "240,230,140", lavenderblush: "255,240,245", lavender: "230,230,250", lawngreen: "124,252,0", lemonchiffon: "255,250,205", lightblue: "173,216,230", lightcoral: "240,128,128", lightcyan: "224,255,255", lightgoldenrodyellow: "250,250,210", lightgray: "211,211,211", lightgrey: "211,211,211", lightgreen: "144,238,144", lightpink: "255,182,193", lightsalmon: "255,160,122", lightseagreen: "32,178,170", lightskyblue: "135,206,250", lightslategray: "119,136,153", lightsteelblue: "176,196,222", lightyellow: "255,255,224", limegreen: "50,205,50", lime: "0,255,0", linen: "250,240,230", magenta: "255,0,255", maroon: "128,0,0", mediumaquamarine: "102,205,170", mediumblue: "0,0,205", mediumorchid: "186,85,211", mediumpurple: "147,112,219", mediumseagreen: "60,179,113", mediumslateblue: "123,104,238", mediumspringgreen: "0,250,154", mediumturquoise: "72,209,204", mediumvioletred: "199,21,133", midnightblue: "25,25,112", mintcream: "245,255,250", mistyrose: "255,228,225", moccasin: "255,228,181", navajowhite: "255,222,173", navy: "0,0,128", oldlace: "253,245,230", olivedrab: "107,142,35", olive: "128,128,0", orangered: "255,69,0", orange: "255,165,0", orchid: "218,112,214", palegoldenrod: "238,232,170", palegreen: "152,251,152", paleturquoise: "175,238,238", palevioletred: "219,112,147", papayawhip: "255,239,213", peachpuff: "255,218,185", peru: "205,133,63", pink: "255,192,203", plum: "221,160,221", powderblue: "176,224,230", purple: "128,0,128", red: "255,0,0", rosybrown: "188,143,143", royalblue: "65,105,225", saddlebrown: "139,69,19", salmon: "250,128,114", sandybrown: "244,164,96", seagreen: "46,139,87", seashell: "255,245,238", sienna: "160,82,45", silver: "192,192,192", skyblue: "135,206,235", slateblue: "106,90,205", slategray: "112,128,144", snow: "255,250,250", springgreen: "0,255,127", steelblue: "70,130,180", tan: "210,180,140", teal: "0,128,128", thistle: "216,191,216", tomato: "255,99,71", turquoise: "64,224,208", violet: "238,130,238", wheat: "245,222,179", whitesmoke: "245,245,245", white: "255,255,255", yellowgreen: "154,205,50", yellow: "255,255,0" } }, Hooks: { templates: { textShadow: ["Color X Y Blur", "black 0px 0px 0px"], boxShadow: ["Color X Y Blur Spread", "black 0px 0px 0px 0px"], clip: ["Top Right Bottom Left", "0px 0px 0px 0px"], backgroundPosition: ["X Y", "0% 0%"], transformOrigin: ["X Y Z", "50% 50% 0px"], perspectiveOrigin: ["X Y", "50% 50%"] }, registered: {}, register: function() { for (var a = 0; a < A.Lists.colors.length; a++) { var b = "color" === A.Lists.colors[a] ? "0 0 0 1" : "255 255 255 1"; A.Hooks.templates[A.Lists.colors[a]] = ["Red Green Blue Alpha", b] } var c, d, e; if (p) for (c in A.Hooks.templates) if (A.Hooks.templates.hasOwnProperty(c)) { d = A.Hooks.templates[c], e = d[0].split(" "); var f = d[1].match(A.RegEx.valueSplit); "Color" === e[0] && (e.push(e.shift()), f.push(f.shift()), A.Hooks.templates[c] = [e.join(" "), f.join(" ")]) } for (c in A.Hooks.templates) if (A.Hooks.templates.hasOwnProperty(c)) { d = A.Hooks.templates[c], e = d[0].split(" "); for (var g in e) if (e.hasOwnProperty(g)) { var h = c + e[g], i = g; A.Hooks.registered[h] = [c, i] } } }, getRoot: function(a) { var b = A.Hooks.registered[a]; return b ? b[0] : a }, getUnit: function(a, b) { var c = (a.substr(b || 0, 5).match(/^[a-z%]+/) || [])[0] || ""; return c && t(A.Lists.units, c) ? c : "" }, fixColors: function(a) { return a.replace(/(rgba?\(\s*)?(\b[a-z]+\b)/g, function(a, b, c) { return A.Lists.colorNames.hasOwnProperty(c) ? (b ? b : "rgba(") + A.Lists.colorNames[c] + (b ? "" : ",1)") : b + c }) }, cleanRootPropertyValue: function(a, b) { return A.RegEx.valueUnwrap.test(b) && (b = b.match(A.RegEx.valueUnwrap)[1]), A.Values.isCSSNullValue(b) && (b = A.Hooks.templates[a][1]), b }, extractValue: function(a, b) { var c = A.Hooks.registered[a]; if (c) { var d = c[0], e = c[1]; return b = A.Hooks.cleanRootPropertyValue(d, b), b.toString().match(A.RegEx.valueSplit)[e] } return b }, injectValue: function(a, b, c) { var d = A.Hooks.registered[a]; if (d) { var e, f = d[0], g = d[1]; return c = A.Hooks.cleanRootPropertyValue(f, c), e = c.toString().match(A.RegEx.valueSplit), e[g] = b, e.join(" ") } return c } }, Normalizations: { registered: { clip: function(a, b, c) { switch (a) { case "name": return "clip"; case "extract": var d; return A.RegEx.wrappedValueAlreadyExtracted.test(c) ? d = c : (d = c.toString().match(A.RegEx.valueUnwrap), d = d ? d[1].replace(/,(\s+)?/g, " ") : c), d; case "inject": return "rect(" + c + ")" } }, blur: function(a, b, c) { switch (a) { case "name": return y.State.isFirefox ? "filter" : "-webkit-filter"; case "extract": var d = parseFloat(c); if (!d && 0 !== d) { var e = c.toString().match(/blur\(([0-9]+[A-z]+)\)/i); d = e ? e[1] : 0 } return d; case "inject": return parseFloat(c) ? "blur(" + c + ")" : "none" } }, opacity: function(a, b, c) { if (p <= 8) switch (a) { case "name": return "filter"; case "extract": var d = c.toString().match(/alpha\(opacity=(.*)\)/i); return c = d ? d[1] / 100 : 1; case "inject": return b.style.zoom = 1, parseFloat(c) >= 1 ? "" : "alpha(opacity=" + parseInt(100 * parseFloat(c), 10) + ")" } else switch (a) { case "name": return "opacity"; case "extract": return c; case "inject": return c } } }, register: function() { function a(a, b, c) { if ("border-box" === A.getPropertyValue(b, "boxSizing").toString().toLowerCase() === (c || !1)) { var d, e, f = 0, g = "width" === a ? ["Left", "Right"] : ["Top", "Bottom"], h = ["padding" + g[0], "padding" + g[1], "border" + g[0] + "Width", "border" + g[1] + "Width"]; for (d = 0; d < h.length; d++) e = parseFloat(A.getPropertyValue(b, h[d])), isNaN(e) || (f += e); return c ? -f : f } return 0 } function b(b, c) { return function(d, e, f) { switch (d) { case "name": return b; case "extract": return parseFloat(f) + a(b, e, c); case "inject": return parseFloat(f) - a(b, e, c) + "px" } } } p && !(p > 9) || y.State.isGingerbread || (A.Lists.transformsBase = A.Lists.transformsBase.concat(A.Lists.transforms3D)); for (var c = 0; c < A.Lists.transformsBase.length; c++) ! function() { var a = A.Lists.transformsBase[c]; A.Normalizations.registered[a] = function(b, c, e) { switch (b) { case "name": return "transform"; case "extract": return g(c) === d || g(c).transformCache[a] === d ? /^scale/i.test(a) ? 1 : 0 : g(c).transformCache[a].replace(/[()]/g, ""); case "inject": var f = !1; switch (a.substr(0, a.length - 1)) { case "translate": f = !/(%|px|em|rem|vw|vh|\d)$/i.test(e); break; case "scal": case "scale": y.State.isAndroid && g(c).transformCache[a] === d && e < 1 && (e = 1), f = !/(\d)$/i.test(e); break; case "skew": f = !/(deg|\d)$/i.test(e); break; case "rotate": f = !/(deg|\d)$/i.test(e) } return f || (g(c).transformCache[a] = "(" + e + ")"), g(c).transformCache[a] } } }(); for (var e = 0; e < A.Lists.colors.length; e++) ! function() { var a = A.Lists.colors[e]; A.Normalizations.registered[a] = function(b, c, e) { switch (b) { case "name": return a; case "extract": var f; if (A.RegEx.wrappedValueAlreadyExtracted.test(e)) f = e; else { var g, h = { black: "rgb(0, 0, 0)", blue: "rgb(0, 0, 255)", gray: "rgb(128, 128, 128)", green: "rgb(0, 128, 0)", red: "rgb(255, 0, 0)", white: "rgb(255, 255, 255)" }; /^[A-z]+$/i.test(e) ? g = h[e] !== d ? h[e] : h.black : A.RegEx.isHex.test(e) ? g = "rgb(" + A.Values.hexToRgb(e).join(" ") + ")" : /^rgba?\(/i.test(e) || (g = h.black), f = (g || e).toString().match(A.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g, " ") } return (!p || p > 8) && 3 === f.split(" ").length && (f += " 1"), f; case "inject": return /^rgb/.test(e) ? e : (p <= 8 ? 4 === e.split(" ").length && (e = e.split(/\s+/).slice(0, 3).join(" ")) : 3 === e.split(" ").length && (e += " 1"), (p <= 8 ? "rgb" : "rgba") + "(" + e.replace(/\s+/g, ",").replace(/\.(\d)+(?=,)/g, "") + ")") } } }(); A.Normalizations.registered.innerWidth = b("width", !0), A.Normalizations.registered.innerHeight = b("height", !0), A.Normalizations.registered.outerWidth = b("width"), A.Normalizations.registered.outerHeight = b("height") } }, Names: { camelCase: function(a) { return a.replace(/-(\w)/g, function(a, b) { return b.toUpperCase() }) }, SVGAttribute: function(a) { var b = "width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2"; return (p || y.State.isAndroid && !y.State.isChrome) && (b += "|transform"), new RegExp("^(" + b + ")$", "i").test(a) }, prefixCheck: function(a) { if (y.State.prefixMatches[a]) return [y.State.prefixMatches[a], !0]; for (var b = ["", "Webkit", "Moz", "ms", "O"], c = 0, d = b.length; c < d; c++) { var e; if (e = 0 === c ? a : b[c] + a.replace(/^\w/, function(a) { return a.toUpperCase() }), u.isString(y.State.prefixElement.style[e])) return y.State.prefixMatches[a] = e, [e, !0] } return [a, !1] } }, Values: { hexToRgb: function(a) { var b, c = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i; return a = a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function(a, b, c, d) { return b + b + c + c + d + d }), b = c.exec(a), b ? [parseInt(b[1], 16), parseInt(b[2], 16), parseInt(b[3], 16)] : [0, 0, 0] }, isCSSNullValue: function(a) { return !a || /^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(a) }, getUnitType: function(a) { return /^(rotate|skew)/i.test(a) ? "deg" : /(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(a) ? "" : "px" }, getDisplayType: function(a) { var b = a && a.tagName.toString().toLowerCase(); return /^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(b) ? "inline" : /^(li)$/i.test(b) ? "list-item" : /^(tr)$/i.test(b) ? "table-row" : /^(table)$/i.test(b) ? "table" : /^(tbody)$/i.test(b) ? "table-row-group" : "block" }, addClass: function(a, b) { if (a) if (a.classList) a.classList.add(b); else if (u.isString(a.className)) a.className += (a.className.length ? " " : "") + b; else { var c = a.getAttribute(p <= 7 ? "className" : "class") || ""; a.setAttribute("class", c + (c ? " " : "") + b) } }, removeClass: function(a, b) { if (a) if (a.classList) a.classList.remove(b); else if (u.isString(a.className)) a.className = a.className.toString().replace(new RegExp("(^|\\s)" + b.split(" ").join("|") + "(\\s|$)", "gi"), " "); else { var c = a.getAttribute(p <= 7 ? "className" : "class") || ""; a.setAttribute("class", c.replace(new RegExp("(^|s)" + b.split(" ").join("|") + "(s|$)", "gi"), " ")) } } }, getPropertyValue: function(a, c, e, f) { function h(a, c) { var e = 0; if (p <= 8) e = o.css(a, c); else { var i = !1; /^(width|height)$/.test(c) && 0 === A.getPropertyValue(a, "display") && (i = !0, A.setPropertyValue(a, "display", A.Values.getDisplayType(a))); var j = function() { i && A.setPropertyValue(a, "display", "none") }; if (!f) { if ("height" === c && "border-box" !== A.getPropertyValue(a, "boxSizing").toString().toLowerCase()) { var k = a.offsetHeight - (parseFloat(A.getPropertyValue(a, "borderTopWidth")) || 0) - (parseFloat(A.getPropertyValue(a, "borderBottomWidth")) || 0) - (parseFloat(A.getPropertyValue(a, "paddingTop")) || 0) - (parseFloat(A.getPropertyValue(a, "paddingBottom")) || 0); return j(), k } if ("width" === c && "border-box" !== A.getPropertyValue(a, "boxSizing").toString().toLowerCase()) { var l = a.offsetWidth - (parseFloat(A.getPropertyValue(a, "borderLeftWidth")) || 0) - (parseFloat(A.getPropertyValue(a, "borderRightWidth")) || 0) - (parseFloat(A.getPropertyValue(a, "paddingLeft")) || 0) - (parseFloat(A.getPropertyValue(a, "paddingRight")) || 0); return j(), l } } var m; m = g(a) === d ? b.getComputedStyle(a, null) : g(a).computedStyle ? g(a).computedStyle : g(a).computedStyle = b.getComputedStyle(a, null), "borderColor" === c && (c = "borderTopColor"), e = 9 === p && "filter" === c ? m.getPropertyValue(c) : m[c], "" !== e && null !== e || (e = a.style[c]), j() } if ("auto" === e && /^(top|right|bottom|left)$/i.test(c)) { var n = h(a, "position"); ("fixed" === n || "absolute" === n && /top|left/i.test(c)) && (e = o(a).position()[c] + "px") } return e } var i; if (A.Hooks.registered[c]) { var j = c, k = A.Hooks.getRoot(j); e === d && (e = A.getPropertyValue(a, A.Names.prefixCheck(k)[0])), A.Normalizations.registered[k] && (e = A.Normalizations.registered[k]("extract", a, e)), i = A.Hooks.extractValue(j, e) } else if (A.Normalizations.registered[c]) { var l, m; l = A.Normalizations.registered[c]("name", a), "transform" !== l && (m = h(a, A.Names.prefixCheck(l)[0]), A.Values.isCSSNullValue(m) && A.Hooks.templates[c] && (m = A.Hooks.templates[c][1])), i = A.Normalizations.registered[c]("extract", a, m) } if (!/^[\d-]/.test(i)) { var n = g(a); if (n && n.isSVG && A.Names.SVGAttribute(c)) if (/^(height|width)$/i.test(c)) try { i = a.getBBox()[c] } catch (q) { i = 0 } else i = a.getAttribute(c); else i = h(a, A.Names.prefixCheck(c)[0]) } return A.Values.isCSSNullValue(i) && (i = 0), y.debug >= 2 && console.log("Get " + c + ": " + i), i }, setPropertyValue: function(a, c, d, e, f) { var h = c; if ("scroll" === c) f.container ? f.container["scroll" + f.direction] = d : "Left" === f.direction ? b.scrollTo(d, f.alternateValue) : b.scrollTo(f.alternateValue, d); else if (A.Normalizations.registered[c] && "transform" === A.Normalizations.registered[c]("name", a)) A.Normalizations.registered[c]("inject", a, d), h = "transform", d = g(a).transformCache[c]; else { if (A.Hooks.registered[c]) { var i = c, j = A.Hooks.getRoot(c); e = e || A.getPropertyValue(a, j), d = A.Hooks.injectValue(i, d, e), c = j } if (A.Normalizations.registered[c] && (d = A.Normalizations.registered[c]("inject", a, d), c = A.Normalizations.registered[c]("name", a)), h = A.Names.prefixCheck(c)[0], p <= 8) try { a.style[h] = d } catch (l) { y.debug && console.log("Browser does not support [" + d + "] for [" + h + "]") } else { var k = g(a); k && k.isSVG && A.Names.SVGAttribute(c) ? a.setAttribute(c, d) : a.style[h] = d } y.debug >= 2 && console.log("Set " + c + " (" + h + "): " + d) } return [h, d] }, flushTransformCache: function(a) { var b = "", c = g(a); if ((p || y.State.isAndroid && !y.State.isChrome) && c && c.isSVG) { var d = function(b) { return parseFloat(A.getPropertyValue(a, b)) }, e = { translate: [d("translateX"), d("translateY")], skewX: [d("skewX")], skewY: [d("skewY")], scale: 1 !== d("scale") ? [d("scale"), d("scale")] : [d("scaleX"), d("scaleY")], rotate: [d("rotateZ"), 0, 0] }; o.each(g(a).transformCache, function(a) { /^translate/i.test(a) ? a = "translate" : /^scale/i.test(a) ? a = "scale" : /^rotate/i.test(a) && (a = "rotate"), e[a] && (b += a + "(" + e[a].join(" ") + ") ", delete e[a]) }) } else { var f, h; o.each(g(a).transformCache, function(c) { if (f = g(a).transformCache[c], "transformPerspective" === c) return h = f, !0; 9 === p && "rotateZ" === c && (c = "rotate"), b += c + f + " " }), h && (b = "perspective" + h + " " + b) } A.setPropertyValue(a, "transform", b) } }; A.Hooks.register(), A.Normalizations.register(), y.hook = function(a, b, c) { var e; return a = f(a), o.each(a, function(a, f) { if (g(f) === d && y.init(f), c === d) e === d && (e = A.getPropertyValue(f, b)); else { var h = A.setPropertyValue(f, b, c); "transform" === h[0] && y.CSS.flushTransformCache(f), e = h } }), e }; var B = function() { function a() { return k ? z.promise || null : p } function e(a, e) { function f(f) { var k, n; if (i.begin && 0 === D) try { i.begin.call(r, r) } catch (V) { setTimeout(function() { throw V }, 1) } if ("scroll" === G) { var p, q, w, x = /^x$/i.test(i.axis) ? "Left" : "Top", B = parseFloat(i.offset) || 0; i.container ? u.isWrapped(i.container) || u.isNode(i.container) ? (i.container = i.container[0] || i.container, p = i.container["scroll" + x], w = p + o(a).position()[x.toLowerCase()] + B) : i.container = null : (p = y.State.scrollAnchor[y.State["scrollProperty" + x]], q = y.State.scrollAnchor[y.State["scrollProperty" + ("Left" === x ? "Top" : "Left")]], w = o(a).offset()[x.toLowerCase()] + B), j = { scroll: { rootPropertyValue: !1, startValue: p, currentValue: p, endValue: w, unitType: "", easing: i.easing, scrollData: { container: i.container, direction: x, alternateValue: q } }, element: a }, y.debug && console.log("tweensContainer (scroll): ", j.scroll, a) } else if ("reverse" === G) { if (!(k = g(a))) return; if (!k.tweensContainer) return void o.dequeue(a, i.queue); "none" === k.opts.display && (k.opts.display = "auto"), "hidden" === k.opts.visibility && (k.opts.visibility = "visible"), k.opts.loop = !1, k.opts.begin = null, k.opts.complete = null, v.easing || delete i.easing, v.duration || delete i.duration, i = o.extend({}, k.opts, i), n = o.extend(!0, {}, k ? k.tweensContainer : null); for (var E in n) if (n.hasOwnProperty(E) && "element" !== E) { var F = n[E].startValue; n[E].startValue = n[E].currentValue = n[E].endValue, n[E].endValue = F, u.isEmptyObject(v) || (n[E].easing = i.easing), y.debug && console.log("reverse tweensContainer (" + E + "): " + JSON.stringify(n[E]), a) } j = n } else if ("start" === G) { k = g(a), k && k.tweensContainer && k.isAnimating === !0 && (n = k.tweensContainer); var H = function(e, f) { var g, l = A.Hooks.getRoot(e), m = !1, p = f[0], q = f[1], r = f[2]; if (!(k && k.isSVG || "tween" === l || A.Names.prefixCheck(l)[1] !== !1 || A.Normalizations.registered[l] !== d)) return void(y.debug && console.log("Skipping [" + l + "] due to a lack of browser support.")); (i.display !== d && null !== i.display && "none" !== i.display || i.visibility !== d && "hidden" !== i.visibility) && /opacity|filter/.test(e) && !r && 0 !== p && (r = 0), i._cacheValues && n && n[e] ? (r === d && (r = n[e].endValue + n[e].unitType), m = k.rootPropertyValueCache[l]) : A.Hooks.registered[e] ? r === d ? (m = A.getPropertyValue(a, l), r = A.getPropertyValue(a, e, m)) : m = A.Hooks.templates[l][1] : r === d && (r = A.getPropertyValue(a, e)); var s, t, v, w = !1, x = function(a, b) { var c, d; return d = (b || "0").toString().toLowerCase().replace(/[%A-z]+$/, function(a) { return c = a, "" }), c || (c = A.Values.getUnitType(a)), [d, c] }; if (r !== p && u.isString(r) && u.isString(p)) { g = ""; var z = 0, B = 0, C = [], D = [], E = 0, F = 0, G = 0; for (r = A.Hooks.fixColors(r), p = A.Hooks.fixColors(p); z < r.length && B < p.length;) { var H = r[z], I = p[B]; if (/[\d\.-]/.test(H) && /[\d\.-]/.test(I)) { for (var J = H, K = I, L = ".", N = "."; ++z < r.length;) { if ((H = r[z]) === L) L = ".."; else if (!/\d/.test(H)) break; J += H } for (; ++B < p.length;) { if ((I = p[B]) === N) N = ".."; else if (!/\d/.test(I)) break; K += I } var O = A.Hooks.getUnit(r, z), P = A.Hooks.getUnit(p, B); if (z += O.length, B += P.length, O === P) J === K ? g += J + O : (g += "{" + C.length + (F ? "!" : "") + "}" + O, C.push(parseFloat(J)), D.push(parseFloat(K))); else { var Q = parseFloat(J), R = parseFloat(K); g += (E < 5 ? "calc" : "") + "(" + (Q ? "{" + C.length + (F ? "!" : "") + "}" : "0") + O + " + " + (R ? "{" + (C.length + (Q ? 1 : 0)) + (F ? "!" : "") + "}" : "0") + P + ")", Q && (C.push(Q), D.push(0)), R && (C.push(0), D.push(R)) } } else { if (H !== I) { E = 0; break } g += H, z++, B++, 0 === E && "c" === H || 1 === E && "a" === H || 2 === E && "l" === H || 3 === E && "c" === H || E >= 4 && "(" === H ? E++ : (E && E < 5 || E >= 4 && ")" === H && --E < 5) && (E = 0), 0 === F && "r" === H || 1 === F && "g" === H || 2 === F && "b" === H || 3 === F && "a" === H || F >= 3 && "(" === H ? (3 === F && "a" === H && (G = 1), F++) : G && "," === H ? ++G > 3 && (F = G = 0) : (G && F < (G ? 5 : 4) || F >= (G ? 4 : 3) && ")" === H && --F < (G ? 5 : 4)) && (F = G = 0) } } z === r.length && B === p.length || (y.debug && console.error('Trying to pattern match mis-matched strings ["' + p + '", "' + r + '"]'), g = d), g && (C.length ? (y.debug && console.log('Pattern found "' + g + '" -> ', C, D, "[" + r + "," + p + "]"), r = C, p = D, t = v = "") : g = d) } g || (s = x(e, r), r = s[0], v = s[1], s = x(e, p), p = s[0].replace(/^([+-\/*])=/, function(a, b) { return w = b, "" }), t = s[1], r = parseFloat(r) || 0, p = parseFloat(p) || 0, "%" === t && (/^(fontSize|lineHeight)$/.test(e) ? (p /= 100, t = "em") : /^scale/.test(e) ? (p /= 100, t = "") : /(Red|Green|Blue)$/i.test(e) && (p = p / 100 * 255, t = ""))); if (/[\/*]/.test(w)) t = v; else if (v !== t && 0 !== r) if (0 === p) t = v; else { h = h || function() { var d = { myParent: a.parentNode || c.body, position: A.getPropertyValue(a, "position"), fontSize: A.getPropertyValue(a, "fontSize") }, e = d.position === M.lastPosition && d.myParent === M.lastParent, f = d.fontSize === M.lastFontSize; M.lastParent = d.myParent, M.lastPosition = d.position, M.lastFontSize = d.fontSize; var g = {}; if (f && e) g.emToPx = M.lastEmToPx, g.percentToPxWidth = M.lastPercentToPxWidth, g.percentToPxHeight = M.lastPercentToPxHeight; else { var h = k && k.isSVG ? c.createElementNS("http://www.w3.org/2000/svg", "rect") : c.createElement("div"); y.init(h), d.myParent.appendChild(h), o.each(["overflow", "overflowX", "overflowY"], function(a, b) { y.CSS.setPropertyValue(h, b, "hidden") }), y.CSS.setPropertyValue(h, "position", d.position), y.CSS.setPropertyValue(h, "fontSize", d.fontSize), y.CSS.setPropertyValue(h, "boxSizing", "content-box"), o.each(["minWidth", "maxWidth", "width", "minHeight", "maxHeight", "height"], function(a, b) { y.CSS.setPropertyValue(h, b, "100%") }), y.CSS.setPropertyValue(h, "paddingLeft", "100em"), g.percentToPxWidth = M.lastPercentToPxWidth = (parseFloat(A.getPropertyValue(h, "width", null, !0)) || 1) / 100, g.percentToPxHeight = M.lastPercentToPxHeight = (parseFloat(A.getPropertyValue(h, "height", null, !0)) || 1) / 100, g.emToPx = M.lastEmToPx = (parseFloat(A.getPropertyValue(h, "paddingLeft")) || 1) / 100, d.myParent.removeChild(h) } return null === M.remToPx && (M.remToPx = parseFloat(A.getPropertyValue(c.body, "fontSize")) || 16), null === M.vwToPx && (M.vwToPx = parseFloat(b.innerWidth) / 100, M.vhToPx = parseFloat(b.innerHeight) / 100), g.remToPx = M.remToPx, g.vwToPx = M.vwToPx, g.vhToPx = M.vhToPx, y.debug >= 1 && console.log("Unit ratios: " + JSON.stringify(g), a), g }(); var S = /margin|padding|left|right|width|text|word|letter/i.test(e) || /X$/.test(e) || "x" === e ? "x" : "y"; switch (v) { case "%": r *= "x" === S ? h.percentToPxWidth : h.percentToPxHeight; break; case "px": break; default: r *= h[v + "ToPx"] } switch (t) { case "%": r *= 1 / ("x" === S ? h.percentToPxWidth : h.percentToPxHeight); break; case "px": break; default: r *= 1 / h[t + "ToPx"] } } switch (w) { case "+": p = r + p; break; case "-": p = r - p; break; case "*": p *= r; break; case "/": p = r / p } j[e] = { rootPropertyValue: m, startValue: r, currentValue: r, endValue: p, unitType: t, easing: q }, g && (j[e].pattern = g), y.debug && console.log("tweensContainer (" + e + "): " + JSON.stringify(j[e]), a) }; for (var I in s) if (s.hasOwnProperty(I)) { var J = A.Names.camelCase(I), K = function(b, c) { var d, f, g; return u.isFunction(b) && (b = b.call(a, e, C)), u.isArray(b) ? (d = b[0], !u.isArray(b[1]) && /^[\d-]/.test(b[1]) || u.isFunction(b[1]) || A.RegEx.isHex.test(b[1]) ? g = b[1] : u.isString(b[1]) && !A.RegEx.isHex.test(b[1]) && y.Easings[b[1]] || u.isArray(b[1]) ? (f = c ? b[1] : l(b[1], i.duration), g = b[2]) : g = b[1] || b[2]) : d = b, c || (f = f || i.easing), u.isFunction(d) && (d = d.call(a, e, C)), u.isFunction(g) && (g = g.call(a, e, C)), [d || 0, f, g] }(s[I]); if (t(A.Lists.colors, J)) { var L = K[0], O = K[1], P = K[2]; if (A.RegEx.isHex.test(L)) { for (var Q = ["Red", "Green", "Blue"], R = A.Values.hexToRgb(L), S = P ? A.Values.hexToRgb(P) : d, T = 0; T < Q.length; T++) { var U = [R[T]]; O && U.push(O), S !== d && U.push(S[T]), H(J + Q[T], U) } continue } } H(J, K) } j.element = a } j.element && (A.Values.addClass(a, "velocity-animating"), N.push(j), k = g(a), k && ("" === i.queue && (k.tweensContainer = j, k.opts = i), k.isAnimating = !0), D === C - 1 ? (y.State.calls.push([N, r, i, null, z.resolver, null, 0]), y.State.isTicking === !1 && (y.State.isTicking = !0, m())) : D++) } var h, i = o.extend({}, y.defaults, v), j = {}; switch (g(a) === d && y.init(a), parseFloat(i.delay) && i.queue !== !1 && o.queue(a, i.queue, function(b) { y.velocityQueueEntryFlag = !0; var c = y.State.delayedElements.count++; y.State.delayedElements[c] = a; var d = function(a) { return function() { y.State.delayedElements[a] = !1, b() } }(c); g(a).delayBegin = (new Date).getTime(), g(a).delay = parseFloat(i.delay), g(a).delayTimer = { setTimeout: setTimeout(b, parseFloat(i.delay)), next: d } }), i.duration.toString().toLowerCase()) { case "fast": i.duration = 200; break; case "normal": i.duration = w; break; case "slow": i.duration = 600; break; default: i.duration = parseFloat(i.duration) || 1 } if (y.mock !== !1 && (y.mock === !0 ? i.duration = i.delay = 1 : (i.duration *= parseFloat(y.mock) || 1, i.delay *= parseFloat(y.mock) || 1)), i.easing = l(i.easing, i.duration), i.begin && !u.isFunction(i.begin) && (i.begin = null), i.progress && !u.isFunction(i.progress) && (i.progress = null), i.complete && !u.isFunction(i.complete) && (i.complete = null), i.display !== d && null !== i.display && (i.display = i.display.toString().toLowerCase(), "auto" === i.display && (i.display = y.CSS.Values.getDisplayType(a))), i.visibility !== d && null !== i.visibility && (i.visibility = i.visibility.toString().toLowerCase()), i.mobileHA = i.mobileHA && y.State.isMobile && !y.State.isGingerbread, i.queue === !1) if (i.delay) { var k = y.State.delayedElements.count++; y.State.delayedElements[k] = a; var n = function(a) { return function() { y.State.delayedElements[a] = !1, f() } }(k); g(a).delayBegin = (new Date).getTime(), g(a).delay = parseFloat(i.delay), g(a).delayTimer = { setTimeout: setTimeout(f, parseFloat(i.delay)), next: n } } else f(); else o.queue(a, i.queue, function(a, b) { if (b === !0) return z.promise && z.resolver(r), !0; y.velocityQueueEntryFlag = !0, f(a) }); "" !== i.queue && "fx" !== i.queue || "inprogress" === o.queue(a)[0] || o.dequeue(a) } var j, k, p, q, r, s, v, x = arguments[0] && (arguments[0].p || o.isPlainObject(arguments[0].properties) && !arguments[0].properties.names || u.isString(arguments[0].properties)); u.isWrapped(this) ? (k = !1, q = 0, r = this, p = this) : (k = !0, q = 1, r = x ? arguments[0].elements || arguments[0].e : arguments[0]); var z = { promise: null, resolver: null, rejecter: null }; if (k && y.Promise && (z.promise = new y.Promise(function(a, b) { z.resolver = a, z.rejecter = b })), x ? (s = arguments[0].properties || arguments[0].p, v = arguments[0].options || arguments[0].o) : (s = arguments[q], v = arguments[q + 1]), !(r = f(r))) return void(z.promise && (s && v && v.promiseRejectEmpty === !1 ? z.resolver() : z.rejecter())); var C = r.length, D = 0; if (!/^(stop|finish|finishAll|pause|resume)$/i.test(s) && !o.isPlainObject(v)) { var E = q + 1; v = {}; for (var F = E; F < arguments.length; F++) u.isArray(arguments[F]) || !/^(fast|normal|slow)$/i.test(arguments[F]) && !/^\d/.test(arguments[F]) ? u.isString(arguments[F]) || u.isArray(arguments[F]) ? v.easing = arguments[F] : u.isFunction(arguments[F]) && (v.complete = arguments[F]) : v.duration = arguments[F] } var G; switch (s) { case "scroll": G = "scroll"; break; case "reverse": G = "reverse"; break; case "pause": var H = (new Date).getTime(); return o.each(r, function(a, b) { h(b, H) }), o.each(y.State.calls, function(a, b) { var c = !1; b && o.each(b[1], function(a, e) { var f = v === d ? "" : v; return f !== !0 && b[2].queue !== f && (v !== d || b[2].queue !== !1) || (o.each(r, function(a, d) { if (d === e) return b[5] = { resume: !1 }, c = !0, !1 }), !c && void 0) }) }), a(); case "resume": return o.each(r, function(a, b) { i(b, H) }), o.each(y.State.calls, function(a, b) { var c = !1; b && o.each(b[1], function(a, e) { var f = v === d ? "" : v; return f !== !0 && b[2].queue !== f && (v !== d || b[2].queue !== !1) || (!b[5] || (o.each(r, function(a, d) { if (d === e) return b[5].resume = !0, c = !0, !1 }), !c && void 0)) }) }), a(); case "finish": case "finishAll": case "stop": o.each(r, function(a, b) { g(b) && g(b).delayTimer && (clearTimeout(g(b).delayTimer.setTimeout), g(b).delayTimer.next && g(b).delayTimer.next(), delete g(b).delayTimer), "finishAll" !== s || v !== !0 && !u.isString(v) || (o.each(o.queue(b, u.isString(v) ? v : ""), function(a, b) { u.isFunction(b) && b() }), o.queue(b, u.isString(v) ? v : "", [])) }); var I = []; return o.each(y.State.calls, function(a, b) { b && o.each(b[1], function(c, e) { var f = v === d ? "" : v; if (f !== !0 && b[2].queue !== f && (v !== d || b[2].queue !== !1)) return !0; o.each(r, function(c, d) { if (d === e) if ((v === !0 || u.isString(v)) && (o.each(o.queue(d, u.isString(v) ? v : ""), function(a, b) { u.isFunction(b) && b(null, !0) }), o.queue(d, u.isString(v) ? v : "", [])), "stop" === s) { var h = g(d); h && h.tweensContainer && f !== !1 && o.each(h.tweensContainer, function(a, b) { b.endValue = b.currentValue }), I.push(a) } else "finish" !== s && "finishAll" !== s || (b[2].duration = 1) }) }) }), "stop" === s && (o.each(I, function(a, b) { n(b, !0) }), z.promise && z.resolver(r)), a(); default: if (!o.isPlainObject(s) || u.isEmptyObject(s)) { if (u.isString(s) && y.Redirects[s]) { j = o.extend({}, v); var J = j.duration, K = j.delay || 0; return j.backwards === !0 && (r = o.extend(!0, [], r).reverse()), o.each(r, function(a, b) { parseFloat(j.stagger) ? j.delay = K + parseFloat(j.stagger) * a : u.isFunction(j.stagger) && (j.delay = K + j.stagger.call(b, a, C)), j.drag && (j.duration = parseFloat(J) || (/^(callout|transition)/.test(s) ? 1e3 : w), j.duration = Math.max(j.duration * (j.backwards ? 1 - a / C : (a + 1) / C), .75 * j.duration, 200)), y.Redirects[s].call(b, b, j || {}, a, C, r, z.promise ? z : d) }), a() } var L = "Velocity: First argument (" + s + ") was not a property map, a known action, or a registered redirect. Aborting."; return z.promise ? z.rejecter(new Error(L)) : b.console && console.log(L), a() } G = "start" } var M = { lastParent: null, lastPosition: null, lastFontSize: null, lastPercentToPxWidth: null, lastPercentToPxHeight: null, lastEmToPx: null, remToPx: null, vwToPx: null, vhToPx: null }, N = []; o.each(r, function(a, b) { u.isNode(b) && e(b, a) }), j = o.extend({}, y.defaults, v), j.loop = parseInt(j.loop, 10); var O = 2 * j.loop - 1; if (j.loop) for (var P = 0; P < O; P++) { var Q = { delay: j.delay, progress: j.progress }; P === O - 1 && (Q.display = j.display, Q.visibility = j.visibility, Q.complete = j.complete), B(r, "reverse", Q) } return a() }; y = o.extend(B, y), y.animate = B; var C = b.requestAnimationFrame || q; if (!y.State.isMobile && c.hidden !== d) { var D = function() { c.hidden ? (C = function(a) { return setTimeout(function() { a(!0) }, 16) }, m()) : C = b.requestAnimationFrame || q }; D(), c.addEventListener("visibilitychange", D) } return a.Velocity = y, a !== b && (a.fn.velocity = B, a.fn.velocity.defaults = y.defaults), o.each(["Down", "Up"], function(a, b) { y.Redirects["slide" + b] = function(a, c, e, f, g, h) { var i = o.extend({}, c), j = i.begin, k = i.complete, l = {}, m = { height: "", marginTop: "", marginBottom: "", paddingTop: "", paddingBottom: "" }; i.display === d && (i.display = "Down" === b ? "inline" === y.CSS.Values.getDisplayType(a) ? "inline-block" : "block" : "none"), i.begin = function() { 0 === e && j && j.call(g, g); for (var c in m) if (m.hasOwnProperty(c)) { l[c] = a.style[c]; var d = A.getPropertyValue(a, c); m[c] = "Down" === b ? [d, 0] : [0, d] } l.overflow = a.style.overflow, a.style.overflow = "hidden" }, i.complete = function() { for (var b in l) l.hasOwnProperty(b) && (a.style[b] = l[b]); e === f - 1 && (k && k.call(g, g), h && h.resolver(g)) }, y(a, m, i) } }), o.each(["In", "Out"], function(a, b) { y.Redirects["fade" + b] = function(a, c, e, f, g, h) { var i = o.extend({}, c), j = i.complete, k = { opacity: "In" === b ? 1 : 0 }; 0 !== e && (i.begin = null), i.complete = e !== f - 1 ? null : function() { j && j.call(g, g), h && h.resolver(g) }, i.display === d && (i.display = "In" === b ? "auto" : "none"), y(this, k, i) } }), y }(window.jQuery || window.Zepto || window, window, window ? window.document : undefined) }); /* Velocity UI(5.2.0) */ (function(factory) { "use strict"; if (typeof require === "function" && typeof exports === "object") { module.exports = factory(); /* AMD module. */ } else if (typeof define === "function" && define.amd) { define(["velocity"], factory); /* Browser globals. */ } else { factory() } }(function() { "use strict"; return function(global, window, document, undefined) { var Velocity = global.Velocity; if (!Velocity || !Velocity.Utilities) { if (window.console) { console.log("Velocity UI Pack: Velocity must be loaded first. Aborting.") } return } var $ = Velocity.Utilities; var velocityVersion = Velocity.version, requiredVersion = { major: 1, minor: 1, patch: 0 }; function greaterSemver(primary, secondary) { var versionInts = []; if (!primary || !secondary) { return !1 } $.each([primary, secondary], function(i, versionObject) { var versionIntsComponents = []; $.each(versionObject, function(component, value) { while (value.toString().length < 5) { value = "0" + value } versionIntsComponents.push(value) }); versionInts.push(versionIntsComponents.join("")) }); return (parseFloat(versionInts[0]) > parseFloat(versionInts[1])) } if (greaterSemver(requiredVersion, velocityVersion)) { var abortError = "Velocity UI Pack: You need to update Velocity (velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity."; alert(abortError); throw new Error(abortError) } Velocity.RegisterEffect = Velocity.RegisterUI = function(effectName, properties) { function animateParentHeight(elements, direction, totalDuration, stagger) { var totalHeightDelta = 0, parentNode; $.each(elements.nodeType ? [elements] : elements, function(i, element) { if (stagger) { totalDuration += i * stagger } parentNode = element.parentNode; var propertiesToSum = ["height", "paddingTop", "paddingBottom", "marginTop", "marginBottom"]; if (Velocity.CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() === "border-box") { propertiesToSum = ["height"] } $.each(propertiesToSum, function(i, property) { totalHeightDelta += parseFloat(Velocity.CSS.getPropertyValue(element, property)) }) }); Velocity.animate(parentNode, { height: (direction === "In" ? "+" : "-") + "=" + totalHeightDelta }, { queue: !1, easing: "ease-in-out", duration: totalDuration * (direction === "In" ? 0.6 : 1) }) } Velocity.Redirects[effectName] = function(element, redirectOptions, elementsIndex, elementsSize, elements, promiseData, loop) { var finalElement = (elementsIndex === elementsSize - 1), totalDuration = 0; loop = loop || properties.loop; if (typeof properties.defaultDuration === "function") { properties.defaultDuration = properties.defaultDuration.call(elements, elements) } else { properties.defaultDuration = parseFloat(properties.defaultDuration) } for (var callIndex = 0; callIndex < properties.calls.length; callIndex++) { durationPercentage = properties.calls[callIndex][1]; if (typeof durationPercentage === "number") { totalDuration += durationPercentage } } var shareDuration = totalDuration >= 1 ? 0 : properties.calls.length ? (1 - totalDuration) / properties.calls.length : 1; for (callIndex = 0; callIndex < properties.calls.length; callIndex++) { var call = properties.calls[callIndex], propertyMap = call[0], redirectDuration = 1000, durationPercentage = call[1], callOptions = call[2] || {}, opts = {}; if (redirectOptions.duration !== undefined) { redirectDuration = redirectOptions.duration } else if (properties.defaultDuration !== undefined) { redirectDuration = properties.defaultDuration } opts.duration = redirectDuration * (typeof durationPercentage === "number" ? durationPercentage : shareDuration); opts.queue = redirectOptions.queue || ""; opts.easing = callOptions.easing || "ease"; opts.delay = parseFloat(callOptions.delay) || 0; opts.loop = !properties.loop && callOptions.loop; opts._cacheValues = callOptions._cacheValues || !0; if (callIndex === 0) { opts.delay += (parseFloat(redirectOptions.delay) || 0); if (elementsIndex === 0) { opts.begin = function() { if (redirectOptions.begin) { redirectOptions.begin.call(elements, elements) } var direction = effectName.match(/(In|Out)$/); if ((direction && direction[0] === "In") && propertyMap.opacity !== undefined) { $.each(elements.nodeType ? [elements] : elements, function(i, element) { Velocity.CSS.setPropertyValue(element, "opacity", 0) }) } if (redirectOptions.animateParentHeight && direction) { animateParentHeight(elements, direction[0], redirectDuration + opts.delay, redirectOptions.stagger) } } } if (redirectOptions.display !== null) { if (redirectOptions.display !== undefined && redirectOptions.display !== "none") { opts.display = redirectOptions.display } else if (/In$/.test(effectName)) { var defaultDisplay = Velocity.CSS.Values.getDisplayType(element); opts.display = (defaultDisplay === "inline") ? "inline-block" : defaultDisplay } } if (redirectOptions.visibility && redirectOptions.visibility !== "hidden") { opts.visibility = redirectOptions.visibility } } if (callIndex === properties.calls.length - 1) { var injectFinalCallbacks = function() { if ((redirectOptions.display === undefined || redirectOptions.display === "none") && /Out$/.test(effectName)) { $.each(elements.nodeType ? [elements] : elements, function(i, element) { Velocity.CSS.setPropertyValue(element, "display", "none") }) } if (redirectOptions.complete) { redirectOptions.complete.call(elements, elements) } if (promiseData) { promiseData.resolver(elements || element) } }; opts.complete = function() { if (loop) { Velocity.Redirects[effectName](element, redirectOptions, elementsIndex, elementsSize, elements, promiseData, loop === !0 ? !0 : Math.max(0, loop - 1)) } if (properties.reset) { for (var resetProperty in properties.reset) { if (!properties.reset.hasOwnProperty(resetProperty)) { continue } var resetValue = properties.reset[resetProperty]; if (Velocity.CSS.Hooks.registered[resetProperty] === undefined && (typeof resetValue === "string" || typeof resetValue === "number")) { properties.reset[resetProperty] = [properties.reset[resetProperty], properties.reset[resetProperty]] } } var resetOptions = { duration: 0, queue: !1 }; if (finalElement) { resetOptions.complete = injectFinalCallbacks } Velocity.animate(element, properties.reset, resetOptions); /* Only trigger the user's complete callback on the last effect call with the last element in the set. */ } else if (finalElement) { injectFinalCallbacks() } }; if (redirectOptions.visibility === "hidden") { opts.visibility = redirectOptions.visibility } } Velocity.animate(element, propertyMap, opts) } }; return Velocity }; Velocity.RegisterEffect.packagedEffects = { "callout.bounce": { defaultDuration: 550, calls: [ [{ translateY: -30 }, 0.25], [{ translateY: 0 }, 0.125], [{ translateY: -15 }, 0.125], [{ translateY: 0 }, 0.25] ] }, "callout.shake": { defaultDuration: 800, calls: [ [{ translateX: -11 }], [{ translateX: 11 }], [{ translateX: -11 }], [{ translateX: 11 }], [{ translateX: -11 }], [{ translateX: 11 }], [{ translateX: -11 }], [{ translateX: 0 }] ] }, "callout.flash": { defaultDuration: 1100, calls: [ [{ opacity: [0, "easeInOutQuad", 1] }], [{ opacity: [1, "easeInOutQuad"] }], [{ opacity: [0, "easeInOutQuad"] }], [{ opacity: [1, "easeInOutQuad"] }] ] }, "callout.pulse": { defaultDuration: 825, calls: [ [{ scaleX: 1.1, scaleY: 1.1 }, 0.50, { easing: "easeInExpo" }], [{ scaleX: 1, scaleY: 1 }, 0.50] ] }, "callout.swing": { defaultDuration: 950, calls: [ [{ rotateZ: 15 }], [{ rotateZ: -10 }], [{ rotateZ: 5 }], [{ rotateZ: -5 }], [{ rotateZ: 0 }] ] }, "callout.tada": { defaultDuration: 1000, calls: [ [{ scaleX: 0.9, scaleY: 0.9, rotateZ: -3 }, 0.10], [{ scaleX: 1.1, scaleY: 1.1, rotateZ: 3 }, 0.10], [{ scaleX: 1.1, scaleY: 1.1, rotateZ: -3 }, 0.10], ["reverse", 0.125], ["reverse", 0.125], ["reverse", 0.125], ["reverse", 0.125], ["reverse", 0.125], [{ scaleX: 1, scaleY: 1, rotateZ: 0 }, 0.20] ] }, "transition.fadeIn": { defaultDuration: 1000, calls: [ [{ opacity: [1, 0] }] ] }, "transition.fadeOut": { defaultDuration: 500, calls: [ [{ opacity: [0, 1] }] ] }, "transition.flipXIn": { defaultDuration: 700, calls: [ [{ opacity: [1, 0], transformPerspective: [800, 800], rotateY: [0, -55] }] ], reset: { transformPerspective: 0 } }, "transition.flipXOut": { defaultDuration: 700, calls: [ [{ opacity: [0, 1], transformPerspective: [800, 800], rotateY: 55 }] ], reset: { transformPerspective: 0, rotateY: 0 } }, "transition.flipYIn": { defaultDuration: 800, calls: [ [{ opacity: [1, 0], transformPerspective: [800, 800], rotateX: [0, -45] }] ], reset: { transformPerspective: 0 } }, "transition.flipYOut": { defaultDuration: 800, calls: [ [{ opacity: [0, 1], transformPerspective: [800, 800], rotateX: 25 }] ], reset: { transformPerspective: 0, rotateX: 0 } }, "transition.flipBounceXIn": { defaultDuration: 900, calls: [ [{ opacity: [0.725, 0], transformPerspective: [400, 400], rotateY: [-10, 90] }, 0.50], [{ opacity: 0.80, rotateY: 10 }, 0.25], [{ opacity: 1, rotateY: 0 }, 0.25] ], reset: { transformPerspective: 0 } }, "transition.flipBounceXOut": { defaultDuration: 800, calls: [ [{ opacity: [0.9, 1], transformPerspective: [400, 400], rotateY: -10 }], [{ opacity: 0, rotateY: 90 }] ], reset: { transformPerspective: 0, rotateY: 0 } }, "transition.flipBounceYIn": { defaultDuration: 850, calls: [ [{ opacity: [0.725, 0], transformPerspective: [400, 400], rotateX: [-10, 90] }, 0.50], [{ opacity: 0.80, rotateX: 10 }, 0.25], [{ opacity: 1, rotateX: 0 }, 0.25] ], reset: { transformPerspective: 0 } }, "transition.flipBounceYOut": { defaultDuration: 800, calls: [ [{ opacity: [0.9, 1], transformPerspective: [400, 400], rotateX: -15 }], [{ opacity: 0, rotateX: 90 }] ], reset: { transformPerspective: 0, rotateX: 0 } }, "transition.swoopIn": { defaultDuration: 850, calls: [ [{ opacity: [1, 0], transformOriginX: ["100%", "50%"], transformOriginY: ["100%", "100%"], scaleX: [1, 0], scaleY: [1, 0], translateX: [0, -700], translateZ: 0 }] ], reset: { transformOriginX: "50%", transformOriginY: "50%" } }, "transition.swoopOut": { defaultDuration: 850, calls: [ [{ opacity: [0, 1], transformOriginX: ["50%", "100%"], transformOriginY: ["100%", "100%"], scaleX: 0, scaleY: 0, translateX: -700, translateZ: 0 }] ], reset: { transformOriginX: "50%", transformOriginY: "50%", scaleX: 1, scaleY: 1, translateX: 0 } }, "transition.whirlIn": { defaultDuration: 850, calls: [ [{ opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 0], scaleY: [1, 0], rotateY: [0, 160] }, 1, { easing: "easeInOutSine" }] ] }, "transition.whirlOut": { defaultDuration: 750, calls: [ [{ opacity: [0, "easeInOutQuint", 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 0, scaleY: 0, rotateY: 160 }, 1, { easing: "swing" }] ], reset: { scaleX: 1, scaleY: 1, rotateY: 0 } }, "transition.shrinkIn": { defaultDuration: 750, calls: [ [{ opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 1.5], scaleY: [1, 1.5], translateZ: 0 }] ] }, "transition.shrinkOut": { defaultDuration: 600, calls: [ [{ opacity: [0, 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 1.3, scaleY: 1.3, translateZ: 0 }] ], reset: { scaleX: 1, scaleY: 1 } }, "transition.expandIn": { defaultDuration: 700, calls: [ [{ opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 0.625], scaleY: [1, 0.625], translateZ: 0 }] ] }, "transition.expandOut": { defaultDuration: 700, calls: [ [{ opacity: [0, 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 0.5, scaleY: 0.5, translateZ: 0 }] ], reset: { scaleX: 1, scaleY: 1 } }, "transition.bounceIn": { defaultDuration: 800, calls: [ [{ opacity: [1, 0], scaleX: [1.05, 0.3], scaleY: [1.05, 0.3] }, 0.35], [{ scaleX: 0.9, scaleY: 0.9, translateZ: 0 }, 0.20], [{ scaleX: 1, scaleY: 1 }, 0.45] ] }, "transition.bounceOut": { defaultDuration: 800, calls: [ [{ scaleX: 0.95, scaleY: 0.95 }, 0.35], [{ scaleX: 1.1, scaleY: 1.1, translateZ: 0 }, 0.35], [{ opacity: [0, 1], scaleX: 0.3, scaleY: 0.3 }, 0.30] ], reset: { scaleX: 1, scaleY: 1 } }, "transition.bounceUpIn": { defaultDuration: 800, calls: [ [{ opacity: [1, 0], translateY: [-30, 1000] }, 0.60, { easing: "easeOutCirc" }], [{ translateY: 10 }, 0.20], [{ translateY: 0 }, 0.20] ] }, "transition.bounceUpOut": { defaultDuration: 1000, calls: [ [{ translateY: 20 }, 0.20], [{ opacity: [0, "easeInCirc", 1], translateY: -1000 }, 0.80] ], reset: { translateY: 0 } }, "transition.bounceDownIn": { defaultDuration: 800, calls: [ [{ opacity: [1, 0], translateY: [30, -1000] }, 0.60, { easing: "easeOutCirc" }], [{ translateY: -10 }, 0.20], [{ translateY: 0 }, 0.20] ] }, "transition.bounceDownOut": { defaultDuration: 1000, calls: [ [{ translateY: -20 }, 0.20], [{ opacity: [0, "easeInCirc", 1], translateY: 1000 }, 0.80] ], reset: { translateY: 0 } }, "transition.bounceLeftIn": { defaultDuration: 750, calls: [ [{ opacity: [1, 0], translateX: [30, -1250] }, 0.60, { easing: "easeOutCirc" }], [{ translateX: -10 }, 0.20], [{ translateX: 0 }, 0.20] ] }, "transition.bounceLeftOut": { defaultDuration: 750, calls: [ [{ translateX: 30 }, 0.20], [{ opacity: [0, "easeInCirc", 1], translateX: -1250 }, 0.80] ], reset: { translateX: 0 } }, "transition.bounceRightIn": { defaultDuration: 750, calls: [ [{ opacity: [1, 0], translateX: [-30, 1250] }, 0.60, { easing: "easeOutCirc" }], [{ translateX: 10 }, 0.20], [{ translateX: 0 }, 0.20] ] }, "transition.bounceRightOut": { defaultDuration: 750, calls: [ [{ translateX: -30 }, 0.20], [{ opacity: [0, "easeInCirc", 1], translateX: 1250 }, 0.80] ], reset: { translateX: 0 } }, "transition.slideUpIn": { defaultDuration: 900, calls: [ [{ opacity: [1, 0], translateY: [0, 20], translateZ: 0 }] ] }, "transition.slideUpOut": { defaultDuration: 900, calls: [ [{ opacity: [0, 1], translateY: -20, translateZ: 0 }] ], reset: { translateY: 0 } }, "transition.slideDownIn": { defaultDuration: 900, calls: [ [{ opacity: [1, 0], translateY: [0, -20], translateZ: 0 }] ] }, "transition.slideDownOut": { defaultDuration: 900, calls: [ [{ opacity: [0, 1], translateY: 20, translateZ: 0 }] ], reset: { translateY: 0 } }, "transition.slideLeftIn": { defaultDuration: 1000, calls: [ [{ opacity: [1, 0], translateX: [0, -20], translateZ: 0 }] ] }, "transition.slideLeftOut": { defaultDuration: 1050, calls: [ [{ opacity: [0, 1], translateX: -20, translateZ: 0 }] ], reset: { translateX: 0 } }, "transition.slideRightIn": { defaultDuration: 1000, calls: [ [{ opacity: [1, 0], translateX: [0, 20], translateZ: 0 }] ] }, "transition.slideRightOut": { defaultDuration: 1050, calls: [ [{ opacity: [0, 1], translateX: 20, translateZ: 0 }] ], reset: { translateX: 0 } }, "transition.slideUpBigIn": { defaultDuration: 850, calls: [ [{ opacity: [1, 0], translateY: [0, 150], translateZ: 0 }] ] }, "transition.slideUpBigOut": { defaultDuration: 800, calls: [ [{ opacity: [0, 1], translateY: -150, translateZ: 0 }] ], reset: { translateY: 0 } }, "transition.slideDownBigIn": { defaultDuration: 850, calls: [ [{ opacity: [1, 0], translateY: [0, -150], translateZ: 0 }] ] }, "transition.slideDownBigOut": { defaultDuration: 800, calls: [ [{ opacity: [0, 1], translateY: 150, translateZ: 0 }] ], reset: { translateY: 0 } }, "transition.slideLeftBigIn": { defaultDuration: 800, calls: [ [{ opacity: [1, 0], translateX: [0, -150], translateZ: 0 }] ] }, "transition.slideLeftBigOut": { defaultDuration: 750, calls: [ [{ opacity: [0, 1], translateX: -150, translateZ: 0 }] ], reset: { translateX: 0 } }, "transition.slideRightBigIn": { defaultDuration: 800, calls: [ [{ opacity: [1, 0], translateX: [0, 150], translateZ: 0 }] ] }, "transition.slideRightBigOut": { defaultDuration: 750, calls: [ [{ opacity: [0, 1], translateX: 150, translateZ: 0 }] ], reset: { translateX: 0 } }, "transition.perspectiveUpIn": { defaultDuration: 800, calls: [ [{ opacity: [1, 0], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: ["100%", "100%"], rotateX: [0, -180] }] ], reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" } }, "transition.perspectiveUpOut": { defaultDuration: 850, calls: [ [{ opacity: [0, 1], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: ["100%", "100%"], rotateX: -180 }] ], reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0 } }, "transition.perspectiveDownIn": { defaultDuration: 800, calls: [ [{ opacity: [1, 0], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateX: [0, 180] }] ], reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" } }, "transition.perspectiveDownOut": { defaultDuration: 850, calls: [ [{ opacity: [0, 1], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateX: 180 }] ], reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0 } }, "transition.perspectiveLeftIn": { defaultDuration: 950, calls: [ [{ opacity: [1, 0], transformPerspective: [2000, 2000], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateY: [0, -180] }] ], reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" } }, "transition.perspectiveLeftOut": { defaultDuration: 950, calls: [ [{ opacity: [0, 1], transformPerspective: [2000, 2000], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateY: -180 }] ], reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0 } }, "transition.perspectiveRightIn": { defaultDuration: 950, calls: [ [{ opacity: [1, 0], transformPerspective: [2000, 2000], transformOriginX: ["100%", "100%"], transformOriginY: [0, 0], rotateY: [0, 180] }] ], reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%" } }, "transition.perspectiveRightOut": { defaultDuration: 950, calls: [ [{ opacity: [0, 1], transformPerspective: [2000, 2000], transformOriginX: ["100%", "100%"], transformOriginY: [0, 0], rotateY: 180 }] ], reset: { transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0 } } }; for (var effectName in Velocity.RegisterEffect.packagedEffects) { if (Velocity.RegisterEffect.packagedEffects.hasOwnProperty(effectName)) { Velocity.RegisterEffect(effectName, Velocity.RegisterEffect.packagedEffects[effectName]) } } Velocity.RunSequence = function(originalSequence) { var sequence = $.extend(!0, [], originalSequence); if (sequence.length > 1) { $.each(sequence.reverse(), function(i, currentCall) { var nextCall = sequence[i + 1]; if (nextCall) { var currentCallOptions = currentCall.o || currentCall.options, nextCallOptions = nextCall.o || nextCall.options; var timing = (currentCallOptions && currentCallOptions.sequenceQueue === !1) ? "begin" : "complete", callbackOriginal = nextCallOptions && nextCallOptions[timing], options = {}; options[timing] = function() { var nextCallElements = nextCall.e || nextCall.elements; var elements = nextCallElements.nodeType ? [nextCallElements] : nextCallElements; if (callbackOriginal) { callbackOriginal.call(elements, elements) } Velocity(currentCall) }; if (nextCall.o) { nextCall.o = $.extend({}, nextCallOptions, options) } else { nextCall.options = $.extend({}, nextCallOptions, options) } } }); sequence.reverse() } Velocity(sequence[0]) } }((window.jQuery || window.Zepto || window), window, (window ? window.document : undefined)) })); (function(a) { 'use strict'; a(document).ready(function() { a(".animate-general").each(function() { var d, e = a(this); if (!e.hasClass("animation-done")) if (e.find(".animated-columns").length) { var f = a(".animated-columns", this), g = e.data("animate-delay"); d = e.find(".animated-columns"), d.each(function() { a(this).css("opacity", "0") }) } else { var f = a(this), g = f.data("animate-delay"); f.data("animate-item") ? (d = f.find(f.data("animate-item")), d.each(function() { a(this).css("opacity", "0") })) : f.css("opacity", "0") } }); var b = function() { a(".animate-general").each(function() { var e, f, g = a(this), h = a(this).data("id"); if ("stagger" == g.data("animate-columns")) { var i = a(".animated-columns", this), j = g.data("animate-stagger"), k = g.data("animate-delay"), l = g.data("animate-out-delay"), m = g.data("animate-duration"), n = g.data("animate-out-duration"), f = g.data("animate-type"), p = g.data("animate-out-type"), q = g.data("animate-offset"); g.css("opacity", "1"), e = g.find(".animated-columns"), g.waypoint(function(a) { "down" === a ? !e.hasClass("animation-done") && e.addClass("animation-done").removeClass("animation-out-done").velocity(f, { delay: k, duration: m, display: "auto", stagger: j }) : "up" == a && "" != p && p != null && !e.hasClass("animation-out-done") && e.addClass("animation-out-done").removeClass("animation-done").velocity(p, { delay: l, duration: n, display: "auto", stagger: j }) }, { offset: q }), e && a("head").append("") } else if ("columns" == g.data("animate-columns")) { var i = a(".animated-columns", this), k = g.data("animate-delay"), l = g.data("animate-out-delay"), f = g.data("animate-type"), p = g.data("animate-out-type"), q = g.data("animate-offset"), m = g.data("animate-duration"), n = g.data("animate-out-duration"); g.css("opacity", "1"), e = g.find(".animated-columns"), e.each(function() { var b = a(this); b.waypoint(function(a) { "down" === a ? !b.hasClass("animation-done") && b.addClass("animation-done").removeClass("animation-out-done").velocity(f, { delay: k, duration: m, drag: !0, display: "auto" }) : "up" == a && "" != p && p != null && !b.hasClass("animation-out-done") && b.addClass("animation-out-done").removeClass("animation-done").velocity(p, { delay: l, duration: n, display: "auto" }) }, { offset: q }) }), e && a("head").append("") } else { var i = a(this), k = i.data("animate-delay"), l = i.data("animate-out-delay"), m = i.data("animate-duration"), n = g.data("animate-out-duration"); f = i.data("animate-type"), p = i.data("animate-out-type"), q = i.data("animate-offset"), i.waypoint(function(a) { "down" === a ? !i.hasClass("animation-done") && i.addClass("animation-done").removeClass("animation-out-done").velocity(f, { delay: k, duration: m, display: "auto" }) : "up" == a && "" != p && p != null && !i.hasClass("animation-out-done") && !i.hasClass("animation-out-done") && i.addClass("animation-out-done").removeClass("animation-done").velocity(p, { delay: l, duration: n, display: "auto" }) }, { offset: q }) } }) }, c = function() { a(".call-on-waypoint").each(function() { var b = a(this); b.waypoint(function() { b.trigger("on-waypoin") }, { triggerOnce: !0, offset: "bottom-in-view" }) }) }; a(document).ready(c), a(window).load(c), a(document.body).on("post-load", function() { c() }), a(document).ready(b), a(window).load(b), a(document.body).on("post-load", function() { b() }), a(document).ready(function() { c(), b() }) }) })(jQuery); /* vivus -v0.4.4 */ "use strict"; ! function() { function t(t) { if ("undefined" == typeof t) throw new Error('Pathformer [constructor]: "element" parameter is required'); if (t.constructor === String && (t = document.getElementById(t), !t)) throw new Error('Pathformer [constructor]: "element" parameter is not related to an existing ID'); if (!(t instanceof window.SVGElement || t instanceof window.SVGGElement || /^svg$/i.test(t.nodeName))) throw new Error('Pathformer [constructor]: "element" parameter must be a string or a SVGelement'); this.el = t, this.scan(t) } function e(t, e, n) { r(), this.isReady = !1, this.setElement(t, e), this.setOptions(e), this.setCallback(n), this.isReady && this.init() } t.prototype.TYPES = ["line", "ellipse", "circle", "polygon", "polyline", "rect"], t.prototype.ATTR_WATCH = ["cx", "cy", "points", "r", "rx", "ry", "x", "x1", "x2", "y", "y1", "y2"], t.prototype.scan = function(t) { for (var e, r, n, i, a = t.querySelectorAll(this.TYPES.join(",")), o = 0; o < a.length; o++) r = a[o], e = this[r.tagName.toLowerCase() + "ToPath"], n = e(this.parseAttr(r.attributes)), i = this.pathMaker(r, n), r.parentNode.replaceChild(i, r) }, t.prototype.lineToPath = function(t) { var e = {}, r = t.x1 || 0, n = t.y1 || 0, i = t.x2 || 0, a = t.y2 || 0; return e.d = "M" + r + "," + n + "L" + i + "," + a, e }, t.prototype.rectToPath = function(t) { var e = {}, r = parseFloat(t.x) || 0, n = parseFloat(t.y) || 0, i = parseFloat(t.width) || 0, a = parseFloat(t.height) || 0; if (t.rx || t.ry) { var o = parseInt(t.rx, 10) || -1, s = parseInt(t.ry, 10) || -1; o = Math.min(Math.max(0 > o ? s : o, 0), i / 2), s = Math.min(Math.max(0 > s ? o : s, 0), a / 2), e.d = "M " + (r + o) + "," + n + " L " + (r + i - o) + "," + n + " A " + o + "," + s + ",0,0,1," + (r + i) + "," + (n + s) + " L " + (r + i) + "," + (n + a - s) + " A " + o + "," + s + ",0,0,1," + (r + i - o) + "," + (n + a) + " L " + (r + o) + "," + (n + a) + " A " + o + "," + s + ",0,0,1," + r + "," + (n + a - s) + " L " + r + "," + (n + s) + " A " + o + "," + s + ",0,0,1," + (r + o) + "," + n } else e.d = "M" + r + " " + n + " L" + (r + i) + " " + n + " L" + (r + i) + " " + (n + a) + " L" + r + " " + (n + a) + " Z"; return e }, t.prototype.polylineToPath = function(t) { var e, r, n = {}, i = t.points.trim().split(" "); if (-1 === t.points.indexOf(",")) { var a = []; for (e = 0; e < i.length; e += 2) a.push(i[e] + "," + i[e + 1]); i = a } for (r = "M" + i[0], e = 1; e < i.length; e++) - 1 !== i[e].indexOf(",") && (r += "L" + i[e]); return n.d = r, n }, t.prototype.polygonToPath = function(e) { var r = t.prototype.polylineToPath(e); return r.d += "Z", r }, t.prototype.ellipseToPath = function(t) { var e = {}, r = parseFloat(t.rx) || 0, n = parseFloat(t.ry) || 0, i = parseFloat(t.cx) || 0, a = parseFloat(t.cy) || 0, o = i - r, s = a, h = parseFloat(i) + parseFloat(r), l = a; return e.d = "M" + o + "," + s + "A" + r + "," + n + " 0,1,1 " + h + "," + l + "A" + r + "," + n + " 0,1,1 " + o + "," + l, e }, t.prototype.circleToPath = function(t) { var e = {}, r = parseFloat(t.r) || 0, n = parseFloat(t.cx) || 0, i = parseFloat(t.cy) || 0, a = n - r, o = i, s = parseFloat(n) + parseFloat(r), h = i; return e.d = "M" + a + "," + o + "A" + r + "," + r + " 0,1,1 " + s + "," + h + "A" + r + "," + r + " 0,1,1 " + a + "," + h, e }, t.prototype.pathMaker = function(t, e) { var r, n, i = document.createElementNS("http://www.w3.org/2000/svg", "path"); for (r = 0; r < t.attributes.length; r++) n = t.attributes[r], -1 === this.ATTR_WATCH.indexOf(n.name) && i.setAttribute(n.name, n.value); for (r in e) i.setAttribute(r, e[r]); return i }, t.prototype.parseAttr = function(t) { for (var e, r = {}, n = 0; n < t.length; n++) { if (e = t[n], -1 !== this.ATTR_WATCH.indexOf(e.name) && -1 !== e.value.indexOf("%")) throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'."); r[e.name] = e.value } return r }; var r, n, i, a; e.LINEAR = function(t) { return t }, e.EASE = function(t) { return -Math.cos(t * Math.PI) / 2 + .5 }, e.EASE_OUT = function(t) { return 1 - Math.pow(1 - t, 3) }, e.EASE_IN = function(t) { return Math.pow(t, 3) }, e.EASE_OUT_BOUNCE = function(t) { var e = -Math.cos(.5 * t * Math.PI) + 1, r = Math.pow(e, 1.5), n = Math.pow(1 - t, 2), i = -Math.abs(Math.cos(2.5 * r * Math.PI)) + 1; return 1 - n + i * n }, e.prototype.setElement = function(t, e) { var r, n; if ("undefined" == typeof t) throw new Error('Vivus [constructor]: "element" parameter is required'); if (t.constructor === String && (t = document.getElementById(t), !t)) throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID'); if (this.parentEl = t, e && e.file) { var n = this; r = function() { var t = document.createElement("div"); t.innerHTML = this.responseText; var r = t.querySelector("svg"); if (!r) throw new Error("Vivus [load]: Cannot find the SVG in the loaded file : " + e.file); n.el = r, n.el.setAttribute("width", "100%"), n.el.setAttribute("height", "100%"), n.parentEl.appendChild(n.el), n.isReady = !0, n.init(), n = null }; var i = new window.XMLHttpRequest; return i.addEventListener("load", r), i.open("GET", e.file), i.send(), void 0 } switch (t.constructor) { case window.SVGSVGElement: case window.SVGElement: case window.SVGGElement: this.el = t, this.isReady = !0; break; case window.HTMLObjectElement: n = this, r = function(e) { if (!n.isReady) { if (n.el = t.contentDocument && t.contentDocument.querySelector("svg"), !n.el && e) throw new Error("Vivus [constructor]: object loaded does not contain any SVG"); n.el && (t.getAttribute("built-by-vivus") && (n.parentEl.insertBefore(n.el, t), n.parentEl.removeChild(t), n.el.setAttribute("width", "100%"), n.el.setAttribute("height", "100%")), n.isReady = !0, n.init(), n = null) } }, r() || t.addEventListener("load", r); break; default: throw new Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)') } }, e.prototype.setOptions = function(t) { var r = ["delayed", "sync", "async", "nsync", "oneByOne", "scenario", "scenario-sync"], n = ["inViewport", "manual", "autostart"]; if (void 0 !== t && t.constructor !== Object) throw new Error('Vivus [constructor]: "options" parameter must be an object'); if (t = t || {}, t.type && -1 === r.indexOf(t.type)) throw new Error("Vivus [constructor]: " + t.type + " is not an existing animation `type`"); if (this.type = t.type || r[0], t.start && -1 === n.indexOf(t.start)) throw new Error("Vivus [constructor]: " + t.start + " is not an existing `start` option"); if (this.start = t.start || n[0], this.isIE = -1 !== window.navigator.userAgent.indexOf("MSIE") || -1 !== window.navigator.userAgent.indexOf("Trident/") || -1 !== window.navigator.userAgent.indexOf("Edge/"), this.duration = a(t.duration, 120), this.delay = a(t.delay, null), this.dashGap = a(t.dashGap, 1), this.forceRender = t.hasOwnProperty("forceRender") ? !!t.forceRender : this.isIE, this.reverseStack = !!t.reverseStack, this.selfDestroy = !!t.selfDestroy, this.onReady = t.onReady, this.map = [], this.frameLength = this.currentFrame = this.delayUnit = this.speed = this.handle = null, this.ignoreInvisible = t.hasOwnProperty("ignoreInvisible") ? !!t.ignoreInvisible : !1, this.animTimingFunction = t.animTimingFunction || e.LINEAR, this.pathTimingFunction = t.pathTimingFunction || e.LINEAR, this.delay >= this.duration) throw new Error("Vivus [constructor]: delay must be shorter than duration") }, e.prototype.setCallback = function(t) { if (t && t.constructor !== Function) throw new Error('Vivus [constructor]: "callback" parameter must be a function'); this.callback = t || function() {} }, e.prototype.mapping = function() { var t, e, r, n, i, o, s, h; for (h = o = s = 0, e = this.el.querySelectorAll("path"), t = 0; t < e.length; t++) r = e[t], this.isInvisible(r) || (i = { el: r, length: Math.ceil(r.getTotalLength()) }, isNaN(i.length) ? window.console && console.warn && console.warn("Vivus [mapping]: cannot retrieve a path element length", r) : (this.map.push(i), r.style.strokeDasharray = i.length + " " + (i.length + 2 * this.dashGap), r.style.strokeDashoffset = i.length + this.dashGap, i.length += this.dashGap, o += i.length, this.renderPath(t))); for (o = 0 === o ? 1 : o, this.delay = null === this.delay ? this.duration / 3 : this.delay, this.delayUnit = this.delay / (e.length > 1 ? e.length - 1 : 1), this.reverseStack && this.map.reverse(), t = 0; t < this.map.length; t++) { switch (i = this.map[t], this.type) { case "delayed": i.startAt = this.delayUnit * t, i.duration = this.duration - this.delay; break; case "oneByOne": i.startAt = s / o * this.duration, i.duration = i.length / o * this.duration; break; case "sync": case "async": case "nsync": i.startAt = 0, i.duration = this.duration; break; case "scenario-sync": r = i.el, n = this.parseAttr(r), i.startAt = h + (a(n["data-delay"], this.delayUnit) || 0), i.duration = a(n["data-duration"], this.duration), h = void 0 !== n["data-async"] ? i.startAt : i.startAt + i.duration, this.frameLength = Math.max(this.frameLength, i.startAt + i.duration); break; case "scenario": r = i.el, n = this.parseAttr(r), i.startAt = a(n["data-start"], this.delayUnit) || 0, i.duration = a(n["data-duration"], this.duration), this.frameLength = Math.max(this.frameLength, i.startAt + i.duration) } s += i.length, this.frameLength = this.frameLength || this.duration } }, e.prototype.drawer = function() { var t = this; if (this.currentFrame += this.speed, this.currentFrame <= 0) this.stop(), this.reset(); else { if (!(this.currentFrame >= this.frameLength)) return this.trace(), this.handle = n(function() { t.drawer() }), void 0; this.stop(), this.currentFrame = this.frameLength, this.trace(), this.selfDestroy && this.destroy() } this.callback(this), this.instanceCallback && (this.instanceCallback(this), this.instanceCallback = null) }, e.prototype.trace = function() { var t, e, r, n; for (n = this.animTimingFunction(this.currentFrame / this.frameLength) * this.frameLength, t = 0; t < this.map.length; t++) r = this.map[t], e = (n - r.startAt) / r.duration, e = this.pathTimingFunction(Math.max(0, Math.min(1, e))), r.progress !== e && (r.progress = e, r.el.style.strokeDashoffset = Math.floor(r.length * (1 - e)), this.renderPath(t)) }, e.prototype.renderPath = function(t) { if (this.forceRender && this.map && this.map[t]) { var e = this.map[t], r = e.el.cloneNode(!0); e.el.parentNode.replaceChild(r, e.el), e.el = r } }, e.prototype.init = function() { this.frameLength = 0, this.currentFrame = 0, this.map = [], new t(this.el), this.mapping(), this.starter(), this.onReady && this.onReady(this) }, e.prototype.starter = function() { switch (this.start) { case "manual": return; case "autostart": this.play(); break; case "inViewport": var t = this, e = function() { t.isInViewport(t.parentEl, 1) && (t.play(), window.removeEventListener("scroll", e)) }; window.addEventListener("scroll", e), e() } }, e.prototype.getStatus = function() { return 0 === this.currentFrame ? "start" : this.currentFrame === this.frameLength ? "end" : "progress" }, e.prototype.reset = function() { return this.setFrameProgress(0) }, e.prototype.finish = function() { return this.setFrameProgress(1) }, e.prototype.setFrameProgress = function(t) { return t = Math.min(1, Math.max(0, t)), this.currentFrame = Math.round(this.frameLength * t), this.trace(), this }, e.prototype.play = function(t, e) { if (this.instanceCallback = null, t && "function" == typeof t) this.instanceCallback = t, t = null; else if (t && "number" != typeof t) throw new Error("Vivus [play]: invalid speed"); return e && "function" == typeof e && !this.instanceCallback && (this.instanceCallback = e), this.speed = t || 1, this.handle || this.drawer(), this }, e.prototype.stop = function() { return this.handle && (i(this.handle), this.handle = null), this }, e.prototype.destroy = function() { this.stop(); var t, e; for (t = 0; t < this.map.length; t++) e = this.map[t], e.el.style.strokeDashoffset = null, e.el.style.strokeDasharray = null, this.renderPath(t) }, e.prototype.isInvisible = function(t) { var e, r = t.getAttribute("data-ignore"); return null !== r ? "false" !== r : this.ignoreInvisible ? (e = t.getBoundingClientRect(), !e.width && !e.height) : !1 }, e.prototype.parseAttr = function(t) { var e, r = {}; if (t && t.attributes) for (var n = 0; n < t.attributes.length; n++) e = t.attributes[n], r[e.name] = e.value; return r }, e.prototype.isInViewport = function(t, e) { var r = this.scrollY(), n = r + this.getViewportH(), i = t.getBoundingClientRect(), a = i.height, o = r + i.top, s = o + a; return e = e || 0, n >= o + a * e && s >= r }, e.prototype.getViewportH = function() { var t = this.docElem.clientHeight, e = window.innerHeight; return e > t ? e : t }, e.prototype.scrollY = function() { return window.pageYOffset || this.docElem.scrollTop }, r = function() { e.prototype.docElem || (e.prototype.docElem = window.document.documentElement, n = function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(t) { return window.setTimeout(t, 1e3 / 60) } }(), i = function() { return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function(t) { return window.clearTimeout(t) } }()) }, a = function(t, e) { var r = parseInt(t, 10); return r >= 0 ? r : e }, "function" == typeof define && define.amd ? define([], function() { return e }) : "object" == typeof exports ? module.exports = e : window.Vivus = e }(); // source --> https://www.opiceblum.com.br/en/wp-content/plugins/animated-svg/assets/js/asvg-click.js?ver=5.3.16 jQuery( function( $ ) { $( document ).on( 'click', 'body:not(.elementor-editor-active) .make-column-clickable-elementor', function( e ) { var wrapper = $( this ), url = wrapper.data( 'column-clickable' ); if ( url ) { if ( $( e.target ).filter( 'a, a *, .no-link, .no-link *' ).length ) { return true; } // handle elementor actions if ( url.match( "^#elementor-action" ) ) { var hash = url; var hash = decodeURIComponent( hash ); // if is Popup if ( hash.includes( "elementor-action:action=popup:open" ) || hash.includes( "elementor-action:action=lightbox" ) ) { if ( 0 === wrapper.find( '#make-column-clickable-open-dynamic' ).length ) { wrapper.append( '
Open dynamic content' ); } wrapper.find( '#make-column-clickable-open-dynamic' ).click(); return true; } return true; } // smooth scroll if ( url.match( "^#" ) ) { var hash = url; $( 'html, body' ).animate( { scrollTop: $( hash ).offset().top }, 800, function() { window.location.hash = hash; }); return true; } window.open( url, wrapper.data( 'column-clickable-blank' ) ); return false; } }); }); // source --> https://www.opiceblum.com.br/en/wp-content/plugins/animated-svg/assets/js/draw-svg.js?ver=5.3.16 ( function ( $ ) { 'use strict'; $.fn.pt_plus_animated_svg = function() { return this.each(function() { var $self = $(this); var data_id=$self.data("id"); var data_duration=$self.data("duration"); var data_type=$self.data("type"); var data_stroke=$self.data("stroke"); var data_fill_color=$self.data("fill_color"); if($self.find(".info_box_svg").length > 0){ $self.find(".info_box_svg > svg").attr("id",data_id); new Vivus(data_id, {type: data_type, duration: data_duration,forceRender:false,start: 'inViewport'}); }else{ new Vivus(data_id, {type: data_type, duration: data_duration,forceRender:false,start: 'inViewport',onReady: function (myVivus) { var c=myVivus.el.childNodes; var show_id=document.getElementById(data_id); show_id.style.opacity = "1"; if(data_stroke!=''){ for (var i = 0; i < c.length; i++) { $(c[i]).attr("fill", data_fill_color); $(c[i]).attr("stroke",data_stroke); var child=c[i]; var pchildern=child.children; if(pchildern != undefined){ for(var j=0; j < pchildern.length; j++){ $(pchildern[j]).attr("fill", data_fill_color); $(pchildern[j]).attr("stroke",data_stroke); } } } } } }); } }); }; var drwSvgReload = function(){ setTimeout(function(){ $('.pt_plus_row_bg_animated_svg').pt_plus_animated_svg(); $('.pt_plus_animated_svg,.ts-hover-draw-svg').pt_plus_animated_svg(); $('body').find('.pt_plus_row_bg_animated_svg').attr('style', 'stroke:black'); }, 100); $('.plus-hover-draw-svg .svg_inner_block').on("mouseenter",function() { var $self; $self = $(this).parent(); var data_id=$self.data("id"); var data_duration=$self.data("duration"); var data_type=$self.data("type"); new Vivus(data_id, {type: data_type, duration: data_duration,start: 'inViewport'}).reset().play(); }).on("mouseleave", function() {}); }; $(document).ready(function() { if (typeof drwSvgReload == 'function'){ drwSvgReload(); } }); $(window).load(function() { if (typeof drwSvgReload == 'function'){ drwSvgReload(); } }); } ( jQuery ) ); // source --> https://www.opiceblum.com.br/en/wp-content/plugins/sticky-header-effects-for-elementor/assets/js/she-header.js?ver=1.3.2 var $j = jQuery.noConflict(); $j( window ).on( 'load', function() { "use strict"; // She header sheHeader(); } ); /* ============================================== HEADER EFFECTS ============================================== */ function sheHeader() { var header = $j('.she-header-yes'), container = $j('.she-header-yes .elementor-container'), header_elementor = $j('.elementor-edit-mode .she-header-yes'), header_logo = $j('.she-header-yes .elementor-container img'), data_settings = header.data('settings'); if ( typeof data_settings != 'undefined' ) { var responsive_settings = data_settings["transparent_on"]; var width = $j(window).width(), header_height= header.height(), logo_width = header_logo.width(), logo_height = header_logo.height() ; } // Check responsive is enabled if( typeof width != 'undefined' && width) { if( width >= 1025 ) { var enabled = "desktop"; }else if (width > 767 && width < 1025 ) { var enabled = "tablet"; }else if (width <= 767 ) { var enabled = "mobile"; } } console.log($j.inArray(enabled, responsive_settings)); if ($j.inArray(enabled, responsive_settings)!='-1') { // height shrink var scroll_distance = data_settings["scroll_distance"]; var transparent_header = data_settings["transparent_header_show"]; var background = data_settings["background"]; var bottom_border_color = data_settings["custom_bottom_border_color"], bottom_border_view = data_settings["bottom_border"], bottom_border_width = data_settings["custom_bottom_border_width"]; var shrink_header = data_settings["shrink_header"], data_height = data_settings["custom_height_header"], data_height_tablet = data_settings["custom_height_header_tablet"], data_height_mobile = data_settings["custom_height_header_mobile"]; var shrink_logo = data_settings["shrink_header_logo"], data_logo_height = data_settings["custom_height_header_logo"], data_logo_height_tablet = data_settings["custom_height_header_logo_tablet"], data_logo_height_mobile = data_settings["custom_height_header_logo_mobile"]; // header height shrink if( typeof data_height != 'undefined' && data_height) { if( width >= 1025 ) { var shrink_height = data_height["size"]; }else if (width > 767 && width < 1025 ) { var shrink_height = data_height_tablet["size"]; if(shrink_height == ''){ shrink_height = data_height["size"]; } }else if (width <= 767 ) { var shrink_height = data_height_mobile["size"]; if(shrink_height == ''){ shrink_height = data_height["size"]; } } } // logo height shrink if( typeof data_logo_height != 'undefined' && data_logo_height) { if( width >= 1025 ) { var shrink_logo_height = data_logo_height["size"]; if(shrink_logo_height == ''){ shrink_logo_height = shrink_height; } var percent = parseInt(shrink_logo_height)/parseInt(header_height), width = logo_width*percent, height = logo_height*percent; }else if (width > 767 && width < 1025 ) { var shrink_logo_height = data_logo_height_tablet["size"]; if(shrink_logo_height == ''){ shrink_logo_height = data_logo_height["size"]; if(shrink_logo_height == ''){ shrink_logo_height = shrink_height; } } var percent = parseInt(shrink_logo_height)/parseInt(header_height), width = logo_width*percent, height = logo_height*percent; }else if (width <= 767 ) { var shrink_logo_height = data_logo_height_mobile["size"]; if(shrink_logo_height == ''){ shrink_logo_height = data_logo_height["size"]; if(shrink_logo_height == ''){ shrink_logo_height = shrink_height; } } var percent = parseInt(shrink_logo_height)/parseInt(header_height), width = logo_width*percent, height = logo_height*percent; } } // border bottom if( typeof bottom_border_width != 'undefined' && bottom_border_width) { var bottom_border = bottom_border_width["size"] + "px solid " + bottom_border_color; } // scroll function $j(window).scroll(function() { var scroll = $j(window).scrollTop(); if (header_elementor) { header_elementor.css("position", "relative"); } if (scroll >= scroll_distance["size"]) { header.removeClass('header').addClass("she-header"); header.css("background-color", background); header.css("border-bottom", bottom_border); header.removeClass('she-header-transparent-yes'); if( shrink_header == "yes" ) { header.css({"padding-top":"0", "padding-bottom":"0", "margin-top":"0", "margin-bottom":"0"}); container.css({"min-height": shrink_height, "transition": "all 0.4s ease-in-out", "-webkit-transition": "all 0.4s ease-in-out", "-moz-transition": "all 0.4s ease-in-out"}); } if( shrink_logo == "yes" ) { header_logo.css({"width": width, "transition": "all 0.4s ease-in-out", "-webkit-transition": "all 0.4s ease-in-out", "-moz-transition": "all 0.4s ease-in-out"}); } } else { header.removeClass("she-header").addClass('header'); header.css("background-color", ""); header.css("border-bottom", ""); if(transparent_header == "yes" ){ header.addClass('she-header-transparent-yes'); } if( shrink_header == "yes" ) { header.css({"padding-top":"", "padding-bottom":"", "margin-top":"", "margin-bottom":""}); container.css("min-height", ""); } if( shrink_logo == "yes" ) { header_logo.css({"height":"", "width":""}); } } }); } }; // source --> https://www.opiceblum.com.br/en/wp-content/themes/OBA/assets/js/libs/owl.carousel.js?ver=2.2.1 /** * Owl Carousel v2.2.1 * Copyright 2013-2017 David Deutsch * Licensed under () */ /** * Owl carousel * @version 2.1.6 * @author Bartosz Wojciechowski * @author David Deutsch * @license The MIT License (MIT) * @todo Lazy Load Icon * @todo prevent animationend bubling * @todo itemsScaleUp * @todo Test Zepto * @todo stagePadding calculate wrong active classes */ ;(function($, window, document, undefined) { /** * Creates a carousel. * @class The Owl Carousel. * @public * @param {HTMLElement|jQuery} element - The element to create the carousel for. * @param {Object} [options] - The options */ function Owl(element, options) { /** * Current settings for the carousel. * @public */ this.settings = null; /** * Current options set by the caller including defaults. * @public */ this.options = $.extend({}, Owl.Defaults, options); /** * Plugin element. * @public */ this.$element = $(element); /** * Proxied event handlers. * @protected */ this._handlers = {}; /** * References to the running plugins of this carousel. * @protected */ this._plugins = {}; /** * Currently suppressed events to prevent them from beeing retriggered. * @protected */ this._supress = {}; /** * Absolute current position. * @protected */ this._current = null; /** * Animation speed in milliseconds. * @protected */ this._speed = null; /** * Coordinates of all items in pixel. * @todo The name of this member is missleading. * @protected */ this._coordinates = []; /** * Current breakpoint. * @todo Real media queries would be nice. * @protected */ this._breakpoint = null; /** * Current width of the plugin element. */ this._width = null; /** * All real items. * @protected */ this._items = []; /** * All cloned items. * @protected */ this._clones = []; /** * Merge values of all items. * @todo Maybe this could be part of a plugin. * @protected */ this._mergers = []; /** * Widths of all items. */ this._widths = []; /** * Invalidated parts within the update process. * @protected */ this._invalidated = {}; /** * Ordered list of workers for the update process. * @protected */ this._pipe = []; /** * Current state information for the drag operation. * @todo #261 * @protected */ this._drag = { time: null, target: null, pointer: null, stage: { start: null, current: null }, direction: null }; /** * Current state information and their tags. * @type {Object} * @protected */ this._states = { current: {}, tags: { 'initializing': [ 'busy' ], 'animating': [ 'busy' ], 'dragging': [ 'interacting' ] } }; $.each([ 'onResize', 'onThrottledResize' ], $.proxy(function(i, handler) { this._handlers[handler] = $.proxy(this[handler], this); }, this)); $.each(Owl.Plugins, $.proxy(function(key, plugin) { this._plugins[key.charAt(0).toLowerCase() + key.slice(1)] = new plugin(this); }, this)); $.each(Owl.Workers, $.proxy(function(priority, worker) { this._pipe.push({ 'filter': worker.filter, 'run': $.proxy(worker.run, this) }); }, this)); this.setup(); this.initialize(); } /** * Default options for the carousel. * @public */ Owl.Defaults = { items: 3, loop: false, center: false, rewind: false, mouseDrag: true, touchDrag: true, pullDrag: true, freeDrag: false, margin: 0, stagePadding: 0, merge: false, mergeFit: true, autoWidth: false, startPosition: 0, rtl: false, smartSpeed: 250, fluidSpeed: false, dragEndSpeed: false, responsive: {}, responsiveRefreshRate: 200, responsiveBaseElement: window, fallbackEasing: 'swing', info: false, nestedItemSelector: false, itemElement: 'div', stageElement: 'div', refreshClass: 'owl-refresh', loadedClass: 'owl-loaded', loadingClass: 'owl-loading', rtlClass: 'owl-rtl', responsiveClass: 'owl-responsive', dragClass: 'owl-drag', itemClass: 'owl-item', stageClass: 'owl-stage', stageOuterClass: 'owl-stage-outer', grabClass: 'owl-grab' }; /** * Enumeration for width. * @public * @readonly * @enum {String} */ Owl.Width = { Default: 'default', Inner: 'inner', Outer: 'outer' }; /** * Enumeration for types. * @public * @readonly * @enum {String} */ Owl.Type = { Event: 'event', State: 'state' }; /** * Contains all registered plugins. * @public */ Owl.Plugins = {}; /** * List of workers involved in the update process. */ Owl.Workers = [ { filter: [ 'width', 'settings' ], run: function() { this._width = this.$element.width(); } }, { filter: [ 'width', 'items', 'settings' ], run: function(cache) { cache.current = this._items && this._items[this.relative(this._current)]; } }, { filter: [ 'items', 'settings' ], run: function() { this.$stage.children('.cloned').remove(); } }, { filter: [ 'width', 'items', 'settings' ], run: function(cache) { var margin = this.settings.margin || '', grid = !this.settings.autoWidth, rtl = this.settings.rtl, css = { 'width': 'auto', 'margin-left': rtl ? margin : '', 'margin-right': rtl ? '' : margin }; !grid && this.$stage.children().css(css); cache.css = css; } }, { filter: [ 'width', 'items', 'settings' ], run: function(cache) { var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin, merge = null, iterator = this._items.length, grid = !this.settings.autoWidth, widths = []; cache.items = { merge: false, width: width }; while (iterator--) { merge = this._mergers[iterator]; merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge; cache.items.merge = merge > 1 || cache.items.merge; widths[iterator] = !grid ? this._items[iterator].width() : width * merge; } this._widths = widths; } }, { filter: [ 'items', 'settings' ], run: function() { var clones = [], items = this._items, settings = this.settings, // TODO: Should be computed from number of min width items in stage view = Math.max(settings.items * 2, 4), size = Math.ceil(items.length / 2) * 2, repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0, append = '', prepend = ''; repeat /= 2; while (repeat--) { // Switch to only using appended clones clones.push(this.normalize(clones.length / 2, true)); append = append + items[clones[clones.length - 1]][0].outerHTML; clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true)); prepend = items[clones[clones.length - 1]][0].outerHTML + prepend; } this._clones = clones; $(append).addClass('cloned').appendTo(this.$stage); $(prepend).addClass('cloned').prependTo(this.$stage); } }, { filter: [ 'width', 'items', 'settings' ], run: function() { var rtl = this.settings.rtl ? 1 : -1, size = this._clones.length + this._items.length, iterator = -1, previous = 0, current = 0, coordinates = []; while (++iterator < size) { previous = coordinates[iterator - 1] || 0; current = this._widths[this.relative(iterator)] + this.settings.margin; coordinates.push(previous + current * rtl); } this._coordinates = coordinates; } }, { filter: [ 'width', 'items', 'settings' ], run: function() { var padding = this.settings.stagePadding, coordinates = this._coordinates, css = { 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2, 'padding-left': padding || '', 'padding-right': padding || '' }; this.$stage.css(css); } }, { filter: [ 'width', 'items', 'settings' ], run: function(cache) { var iterator = this._coordinates.length, grid = !this.settings.autoWidth, items = this.$stage.children(); if (grid && cache.items.merge) { while (iterator--) { cache.css.width = this._widths[this.relative(iterator)]; items.eq(iterator).css(cache.css); } } else if (grid) { cache.css.width = cache.items.width; items.css(cache.css); } } }, { filter: [ 'items' ], run: function() { this._coordinates.length < 1 && this.$stage.removeAttr('style'); } }, { filter: [ 'width', 'items', 'settings' ], run: function(cache) { cache.current = cache.current ? this.$stage.children().index(cache.current) : 0; cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current)); this.reset(cache.current); } }, { filter: [ 'position' ], run: function() { this.animate(this.coordinates(this._current)); } }, { filter: [ 'width', 'position', 'items', 'settings' ], run: function() { var rtl = this.settings.rtl ? 1 : -1, padding = this.settings.stagePadding * 2, begin = this.coordinates(this.current()) + padding, end = begin + this.width() * rtl, inner, outer, matches = [], i, n; for (i = 0, n = this._coordinates.length; i < n; i++) { inner = this._coordinates[i - 1] || 0; outer = Math.abs(this._coordinates[i]) + padding * rtl; if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end))) || (this.op(outer, '<', begin) && this.op(outer, '>', end))) { matches.push(i); } } this.$stage.children('.active').removeClass('active'); this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active'); if (this.settings.center) { this.$stage.children('.center').removeClass('center'); this.$stage.children().eq(this.current()).addClass('center'); } } } ]; /** * Initializes the carousel. * @protected */ Owl.prototype.initialize = function() { this.enter('initializing'); this.trigger('initialize'); this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl); if (this.settings.autoWidth && !this.is('pre-loading')) { var imgs, nestedSelector, width; imgs = this.$element.find('img'); nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined; width = this.$element.children(nestedSelector).width(); if (imgs.length && width <= 0) { this.preloadAutoWidthImages(imgs); } } this.$element.addClass(this.options.loadingClass); // create stage this.$stage = $('<' + this.settings.stageElement + ' class="' + this.settings.stageClass + '"/>') .wrap('
'); // append stage this.$element.append(this.$stage.parent()); // append content this.replace(this.$element.children().not(this.$stage.parent())); // check visibility if (this.$element.is(':visible')) { // update view this.refresh(); } else { // invalidate width this.invalidate('width'); } this.$element .removeClass(this.options.loadingClass) .addClass(this.options.loadedClass); // register event handlers this.registerEventHandlers(); this.leave('initializing'); this.trigger('initialized'); }; /** * Setups the current settings. * @todo Remove responsive classes. Why should adaptive designs be brought into IE8? * @todo Support for media queries by using `matchMedia` would be nice. * @public */ Owl.prototype.setup = function() { var viewport = this.viewport(), overwrites = this.options.responsive, match = -1, settings = null; if (!overwrites) { settings = $.extend({}, this.options); } else { $.each(overwrites, function(breakpoint) { if (breakpoint <= viewport && breakpoint > match) { match = Number(breakpoint); } }); settings = $.extend({}, this.options, overwrites[match]); if (typeof settings.stagePadding === 'function') { settings.stagePadding = settings.stagePadding(); } delete settings.responsive; // responsive class if (settings.responsiveClass) { this.$element.attr('class', this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match) ); } } this.trigger('change', { property: { name: 'settings', value: settings } }); this._breakpoint = match; this.settings = settings; this.invalidate('settings'); this.trigger('changed', { property: { name: 'settings', value: this.settings } }); }; /** * Updates option logic if necessery. * @protected */ Owl.prototype.optionsLogic = function() { if (this.settings.autoWidth) { this.settings.stagePadding = false; this.settings.merge = false; } }; /** * Prepares an item before add. * @todo Rename event parameter `content` to `item`. * @protected * @returns {jQuery|HTMLElement} - The item container. */ Owl.prototype.prepare = function(item) { var event = this.trigger('prepare', { content: item }); if (!event.data) { event.data = $('<' + this.settings.itemElement + '/>') .addClass(this.options.itemClass).append(item) } this.trigger('prepared', { content: event.data }); return event.data; }; /** * Updates the view. * @public */ Owl.prototype.update = function() { var i = 0, n = this._pipe.length, filter = $.proxy(function(p) { return this[p] }, this._invalidated), cache = {}; while (i < n) { if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) { this._pipe[i].run(cache); } i++; } this._invalidated = {}; !this.is('valid') && this.enter('valid'); }; /** * Gets the width of the view. * @public * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return. * @returns {Number} - The width of the view in pixel. */ Owl.prototype.width = function(dimension) { dimension = dimension || Owl.Width.Default; switch (dimension) { case Owl.Width.Inner: case Owl.Width.Outer: return this._width; default: return this._width - this.settings.stagePadding * 2 + this.settings.margin; } }; /** * Refreshes the carousel primarily for adaptive purposes. * @public */ Owl.prototype.refresh = function() { this.enter('refreshing'); this.trigger('refresh'); this.setup(); this.optionsLogic(); this.$element.addClass(this.options.refreshClass); this.update(); this.$element.removeClass(this.options.refreshClass); this.leave('refreshing'); this.trigger('refreshed'); }; /** * Checks window `resize` event. * @protected */ Owl.prototype.onThrottledResize = function() { window.clearTimeout(this.resizeTimer); this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate); }; /** * Checks window `resize` event. * @protected */ Owl.prototype.onResize = function() { if (!this._items.length) { return false; } if (this._width === this.$element.width()) { return false; } if (!this.$element.is(':visible')) { return false; } this.enter('resizing'); if (this.trigger('resize').isDefaultPrevented()) { this.leave('resizing'); return false; } this.invalidate('width'); this.refresh(); this.leave('resizing'); this.trigger('resized'); }; /** * Registers event handlers. * @todo Check `msPointerEnabled` * @todo #261 * @protected */ Owl.prototype.registerEventHandlers = function() { if ($.support.transition) { this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this)); } if (this.settings.responsive !== false) { this.on(window, 'resize', this._handlers.onThrottledResize); } if (this.settings.mouseDrag) { this.$element.addClass(this.options.dragClass); this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this)); this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { return false }); } if (this.settings.touchDrag){ this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this)); this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this)); } }; /** * Handles `touchstart` and `mousedown` events. * @todo Horizontal swipe threshold as option * @todo #261 * @protected * @param {Event} event - The event arguments. */ Owl.prototype.onDragStart = function(event) { var stage = null; if (event.which === 3) { return; } if ($.support.transform) { stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(','); stage = { x: stage[stage.length === 16 ? 12 : 4], y: stage[stage.length === 16 ? 13 : 5] }; } else { stage = this.$stage.position(); stage = { x: this.settings.rtl ? stage.left + this.$stage.width() - this.width() + this.settings.margin : stage.left, y: stage.top }; } if (this.is('animating')) { $.support.transform ? this.animate(stage.x) : this.$stage.stop() this.invalidate('position'); } this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown'); this.speed(0); this._drag.time = new Date().getTime(); this._drag.target = $(event.target); this._drag.stage.start = stage; this._drag.stage.current = stage; this._drag.pointer = this.pointer(event); $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this)); $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) { var delta = this.difference(this._drag.pointer, this.pointer(event)); $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this)); if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) { return; } event.preventDefault(); this.enter('dragging'); this.trigger('drag'); }, this)); }; /** * Handles the `touchmove` and `mousemove` events. * @todo #261 * @protected * @param {Event} event - The event arguments. */ Owl.prototype.onDragMove = function(event) { var minimum = null, maximum = null, pull = null, delta = this.difference(this._drag.pointer, this.pointer(event)), stage = this.difference(this._drag.stage.start, delta); if (!this.is('dragging')) { return; } event.preventDefault(); if (this.settings.loop) { minimum = this.coordinates(this.minimum()); maximum = this.coordinates(this.maximum() + 1) - minimum; stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum; } else { minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()); maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()); pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0; stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull); } this._drag.stage.current = stage; this.animate(stage.x); }; /** * Handles the `touchend` and `mouseup` events. * @todo #261 * @todo Threshold for click event * @protected * @param {Event} event - The event arguments. */ Owl.prototype.onDragEnd = function(event) { var delta = this.difference(this._drag.pointer, this.pointer(event)), stage = this._drag.stage.current, direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right'; $(document).off('.owl.core'); this.$element.removeClass(this.options.grabClass); if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) { this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed); this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction)); this.invalidate('position'); this.update(); this._drag.direction = direction; if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) { this._drag.target.one('click.owl.core', function() { return false; }); } } if (!this.is('dragging')) { return; } this.leave('dragging'); this.trigger('dragged'); }; /** * Gets absolute position of the closest item for a coordinate. * @todo Setting `freeDrag` makes `closest` not reusable. See #165. * @protected * @param {Number} coordinate - The coordinate in pixel. * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`. * @return {Number} - The absolute position of the closest item. */ Owl.prototype.closest = function(coordinate, direction) { var position = -1, pull = 30, width = this.width(), coordinates = this.coordinates(); if (!this.settings.freeDrag) { // check closest item $.each(coordinates, $.proxy(function(index, value) { // on a left pull, check on current index if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) { position = index; // on a right pull, check on previous index // to do so, subtract width from value and set position = index + 1 } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) { position = index + 1; } else if (this.op(coordinate, '<', value) && this.op(coordinate, '>', coordinates[index + 1] || value - width)) { position = direction === 'left' ? index + 1 : index; } return position === -1; }, this)); } if (!this.settings.loop) { // non loop boundries if (this.op(coordinate, '>', coordinates[this.minimum()])) { position = coordinate = this.minimum(); } else if (this.op(coordinate, '<', coordinates[this.maximum()])) { position = coordinate = this.maximum(); } } return position; }; /** * Animates the stage. * @todo #270 * @public * @param {Number} coordinate - The coordinate in pixels. */ Owl.prototype.animate = function(coordinate) { var animate = this.speed() > 0; this.is('animating') && this.onTransitionEnd(); if (animate) { this.enter('animating'); this.trigger('translate'); } if ($.support.transform3d && $.support.transition) { this.$stage.css({ transform: 'translate3d(' + coordinate + 'px,0px,0px)', transition: (this.speed() / 1000) + 's' }); } else if (animate) { this.$stage.animate({ left: coordinate + 'px' }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this)); } else { this.$stage.css({ left: coordinate + 'px' }); } }; /** * Checks whether the carousel is in a specific state or not. * @param {String} state - The state to check. * @returns {Boolean} - The flag which indicates if the carousel is busy. */ Owl.prototype.is = function(state) { return this._states.current[state] && this._states.current[state] > 0; }; /** * Sets the absolute position of the current item. * @public * @param {Number} [position] - The new absolute position or nothing to leave it unchanged. * @returns {Number} - The absolute position of the current item. */ Owl.prototype.current = function(position) { if (position === undefined) { return this._current; } if (this._items.length === 0) { return undefined; } position = this.normalize(position); if (this._current !== position) { var event = this.trigger('change', { property: { name: 'position', value: position } }); if (event.data !== undefined) { position = this.normalize(event.data); } this._current = position; this.invalidate('position'); this.trigger('changed', { property: { name: 'position', value: this._current } }); } return this._current; }; /** * Invalidates the given part of the update routine. * @param {String} [part] - The part to invalidate. * @returns {Array.} - The invalidated parts. */ Owl.prototype.invalidate = function(part) { if ($.type(part) === 'string') { this._invalidated[part] = true; this.is('valid') && this.leave('valid'); } return $.map(this._invalidated, function(v, i) { return i }); }; /** * Resets the absolute position of the current item. * @public * @param {Number} position - The absolute position of the new item. */ Owl.prototype.reset = function(position) { position = this.normalize(position); if (position === undefined) { return; } this._speed = 0; this._current = position; this.suppress([ 'translate', 'translated' ]); this.animate(this.coordinates(position)); this.release([ 'translate', 'translated' ]); }; /** * Normalizes an absolute or a relative position of an item. * @public * @param {Number} position - The absolute or relative position to normalize. * @param {Boolean} [relative=false] - Whether the given position is relative or not. * @returns {Number} - The normalized position. */ Owl.prototype.normalize = function(position, relative) { var n = this._items.length, m = relative ? 0 : this._clones.length; if (!this.isNumeric(position) || n < 1) { position = undefined; } else if (position < 0 || position >= n + m) { position = ((position - m / 2) % n + n) % n + m / 2; } return position; }; /** * Converts an absolute position of an item into a relative one. * @public * @param {Number} position - The absolute position to convert. * @returns {Number} - The converted position. */ Owl.prototype.relative = function(position) { position -= this._clones.length / 2; return this.normalize(position, true); }; /** * Gets the maximum position for the current item. * @public * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position. * @returns {Number} */ Owl.prototype.maximum = function(relative) { var settings = this.settings, maximum = this._coordinates.length, iterator, reciprocalItemsWidth, elementWidth; if (settings.loop) { maximum = this._clones.length / 2 + this._items.length - 1; } else if (settings.autoWidth || settings.merge) { iterator = this._items.length; reciprocalItemsWidth = this._items[--iterator].width(); elementWidth = this.$element.width(); while (iterator--) { reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin; if (reciprocalItemsWidth > elementWidth) { break; } } maximum = iterator + 1; } else if (settings.center) { maximum = this._items.length - 1; } else { maximum = this._items.length - settings.items; } if (relative) { maximum -= this._clones.length / 2; } return Math.max(maximum, 0); }; /** * Gets the minimum position for the current item. * @public * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position. * @returns {Number} */ Owl.prototype.minimum = function(relative) { return relative ? 0 : this._clones.length / 2; }; /** * Gets an item at the specified relative position. * @public * @param {Number} [position] - The relative position of the item. * @return {jQuery|Array.} - The item at the given position or all items if no position was given. */ Owl.prototype.items = function(position) { if (position === undefined) { return this._items.slice(); } position = this.normalize(position, true); return this._items[position]; }; /** * Gets an item at the specified relative position. * @public * @param {Number} [position] - The relative position of the item. * @return {jQuery|Array.} - The item at the given position or all items if no position was given. */ Owl.prototype.mergers = function(position) { if (position === undefined) { return this._mergers.slice(); } position = this.normalize(position, true); return this._mergers[position]; }; /** * Gets the absolute positions of clones for an item. * @public * @param {Number} [position] - The relative position of the item. * @returns {Array.} - The absolute positions of clones for the item or all if no position was given. */ Owl.prototype.clones = function(position) { var odd = this._clones.length / 2, even = odd + this._items.length, map = function(index) { return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 }; if (position === undefined) { return $.map(this._clones, function(v, i) { return map(i) }); } return $.map(this._clones, function(v, i) { return v === position ? map(i) : null }); }; /** * Sets the current animation speed. * @public * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged. * @returns {Number} - The current animation speed in milliseconds. */ Owl.prototype.speed = function(speed) { if (speed !== undefined) { this._speed = speed; } return this._speed; }; /** * Gets the coordinate of an item. * @todo The name of this method is missleanding. * @public * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`. * @returns {Number|Array.} - The coordinate of the item in pixel or all coordinates. */ Owl.prototype.coordinates = function(position) { var multiplier = 1, newPosition = position - 1, coordinate; if (position === undefined) { return $.map(this._coordinates, $.proxy(function(coordinate, index) { return this.coordinates(index); }, this)); } if (this.settings.center) { if (this.settings.rtl) { multiplier = -1; newPosition = position + 1; } coordinate = this._coordinates[position]; coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier; } else { coordinate = this._coordinates[newPosition] || 0; } coordinate = Math.ceil(coordinate); return coordinate; }; /** * Calculates the speed for a translation. * @protected * @param {Number} from - The absolute position of the start item. * @param {Number} to - The absolute position of the target item. * @param {Number} [factor=undefined] - The time factor in milliseconds. * @returns {Number} - The time in milliseconds for the translation. */ Owl.prototype.duration = function(from, to, factor) { if (factor === 0) { return 0; } return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed)); }; /** * Slides to the specified item. * @public * @param {Number} position - The position of the item. * @param {Number} [speed] - The time in milliseconds for the transition. */ Owl.prototype.to = function(position, speed) { var current = this.current(), revert = null, distance = position - this.relative(current), direction = (distance > 0) - (distance < 0), items = this._items.length, minimum = this.minimum(), maximum = this.maximum(); if (this.settings.loop) { if (!this.settings.rewind && Math.abs(distance) > items / 2) { distance += direction * -1 * items; } position = current + distance; revert = ((position - minimum) % items + items) % items + minimum; if (revert !== position && revert - distance <= maximum && revert - distance > 0) { current = revert - distance; position = revert; this.reset(current); } } else if (this.settings.rewind) { maximum += 1; position = (position % maximum + maximum) % maximum; } else { position = Math.max(minimum, Math.min(maximum, position)); } this.speed(this.duration(current, position, speed)); this.current(position); if (this.$element.is(':visible')) { this.update(); } }; /** * Slides to the next item. * @public * @param {Number} [speed] - The time in milliseconds for the transition. */ Owl.prototype.next = function(speed) { speed = speed || false; this.to(this.relative(this.current()) + 1, speed); }; /** * Slides to the previous item. * @public * @param {Number} [speed] - The time in milliseconds for the transition. */ Owl.prototype.prev = function(speed) { speed = speed || false; this.to(this.relative(this.current()) - 1, speed); }; /** * Handles the end of an animation. * @protected * @param {Event} event - The event arguments. */ Owl.prototype.onTransitionEnd = function(event) { // if css2 animation then event object is undefined if (event !== undefined) { event.stopPropagation(); // Catch only owl-stage transitionEnd event if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) { return false; } } this.leave('animating'); this.trigger('translated'); }; /** * Gets viewport width. * @protected * @return {Number} - The width in pixel. */ Owl.prototype.viewport = function() { var width; if (this.options.responsiveBaseElement !== window) { width = $(this.options.responsiveBaseElement).width(); } else if (window.innerWidth) { width = window.innerWidth; } else if (document.documentElement && document.documentElement.clientWidth) { width = document.documentElement.clientWidth; } else { console.warn('Can not detect viewport width.'); } return width; }; /** * Replaces the current content. * @public * @param {HTMLElement|jQuery|String} content - The new content. */ Owl.prototype.replace = function(content) { this.$stage.empty(); this._items = []; if (content) { content = (content instanceof jQuery) ? content : $(content); } if (this.settings.nestedItemSelector) { content = content.find('.' + this.settings.nestedItemSelector); } content.filter(function() { return this.nodeType === 1; }).each($.proxy(function(index, item) { item = this.prepare(item); this.$stage.append(item); this._items.push(item); this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); }, this)); this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0); this.invalidate('items'); }; /** * Adds an item. * @todo Use `item` instead of `content` for the event arguments. * @public * @param {HTMLElement|jQuery|String} content - The item content to add. * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end. */ Owl.prototype.add = function(content, position) { var current = this.relative(this._current); position = position === undefined ? this._items.length : this.normalize(position, true); content = content instanceof jQuery ? content : $(content); this.trigger('add', { content: content, position: position }); content = this.prepare(content); if (this._items.length === 0 || position === this._items.length) { this._items.length === 0 && this.$stage.append(content); this._items.length !== 0 && this._items[position - 1].after(content); this._items.push(content); this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); } else { this._items[position].before(content); this._items.splice(position, 0, content); this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); } this._items[current] && this.reset(this._items[current].index()); this.invalidate('items'); this.trigger('added', { content: content, position: position }); }; /** * Removes an item by its position. * @todo Use `item` instead of `content` for the event arguments. * @public * @param {Number} position - The relative position of the item to remove. */ Owl.prototype.remove = function(position) { position = this.normalize(position, true); if (position === undefined) { return; } this.trigger('remove', { content: this._items[position], position: position }); this._items[position].remove(); this._items.splice(position, 1); this._mergers.splice(position, 1); this.invalidate('items'); this.trigger('removed', { content: null, position: position }); }; /** * Preloads images with auto width. * @todo Replace by a more generic approach * @protected */ Owl.prototype.preloadAutoWidthImages = function(images) { images.each($.proxy(function(i, element) { this.enter('pre-loading'); element = $(element); $(new Image()).one('load', $.proxy(function(e) { element.attr('src', e.target.src); element.css('opacity', 1); this.leave('pre-loading'); !this.is('pre-loading') && !this.is('initializing') && this.refresh(); }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina')); }, this)); }; /** * Destroys the carousel. * @public */ Owl.prototype.destroy = function() { this.$element.off('.owl.core'); this.$stage.off('.owl.core'); $(document).off('.owl.core'); if (this.settings.responsive !== false) { window.clearTimeout(this.resizeTimer); this.off(window, 'resize', this._handlers.onThrottledResize); } for (var i in this._plugins) { this._plugins[i].destroy(); } this.$stage.children('.cloned').remove(); this.$stage.unwrap(); this.$stage.children().contents().unwrap(); this.$stage.children().unwrap(); this.$element .removeClass(this.options.refreshClass) .removeClass(this.options.loadingClass) .removeClass(this.options.loadedClass) .removeClass(this.options.rtlClass) .removeClass(this.options.dragClass) .removeClass(this.options.grabClass) .attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s', 'g'), '')) .removeData('owl.carousel'); }; /** * Operators to calculate right-to-left and left-to-right. * @protected * @param {Number} [a] - The left side operand. * @param {String} [o] - The operator. * @param {Number} [b] - The right side operand. */ Owl.prototype.op = function(a, o, b) { var rtl = this.settings.rtl; switch (o) { case '<': return rtl ? a > b : a < b; case '>': return rtl ? a < b : a > b; case '>=': return rtl ? a <= b : a >= b; case '<=': return rtl ? a >= b : a <= b; default: break; } }; /** * Attaches to an internal event. * @protected * @param {HTMLElement} element - The event source. * @param {String} event - The event name. * @param {Function} listener - The event handler to attach. * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not. */ Owl.prototype.on = function(element, event, listener, capture) { if (element.addEventListener) { element.addEventListener(event, listener, capture); } else if (element.attachEvent) { element.attachEvent('on' + event, listener); } }; /** * Detaches from an internal event. * @protected * @param {HTMLElement} element - The event source. * @param {String} event - The event name. * @param {Function} listener - The attached event handler to detach. * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not. */ Owl.prototype.off = function(element, event, listener, capture) { if (element.removeEventListener) { element.removeEventListener(event, listener, capture); } else if (element.detachEvent) { element.detachEvent('on' + event, listener); } }; /** * Triggers a public event. * @todo Remove `status`, `relatedTarget` should be used instead. * @protected * @param {String} name - The event name. * @param {*} [data=null] - The event data. * @param {String} [namespace=carousel] - The event namespace. * @param {String} [state] - The state which is associated with the event. * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not. * @returns {Event} - The event arguments. */ Owl.prototype.trigger = function(name, data, namespace, state, enter) { var status = { item: { count: this._items.length, index: this.current() } }, handler = $.camelCase( $.grep([ 'on', name, namespace ], function(v) { return v }) .join('-').toLowerCase() ), event = $.Event( [ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(), $.extend({ relatedTarget: this }, status, data) ); if (!this._supress[name]) { $.each(this._plugins, function(name, plugin) { if (plugin.onTrigger) { plugin.onTrigger(event); } }); this.register({ type: Owl.Type.Event, name: name }); this.$element.trigger(event); if (this.settings && typeof this.settings[handler] === 'function') { this.settings[handler].call(this, event); } } return event; }; /** * Enters a state. * @param name - The state name. */ Owl.prototype.enter = function(name) { $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) { if (this._states.current[name] === undefined) { this._states.current[name] = 0; } this._states.current[name]++; }, this)); }; /** * Leaves a state. * @param name - The state name. */ Owl.prototype.leave = function(name) { $.each([ name ].concat(this._states.tags[name] || []), $.proxy(function(i, name) { this._states.current[name]--; }, this)); }; /** * Registers an event or state. * @public * @param {Object} object - The event or state to register. */ Owl.prototype.register = function(object) { if (object.type === Owl.Type.Event) { if (!$.event.special[object.name]) { $.event.special[object.name] = {}; } if (!$.event.special[object.name].owl) { var _default = $.event.special[object.name]._default; $.event.special[object.name]._default = function(e) { if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) { return _default.apply(this, arguments); } return e.namespace && e.namespace.indexOf('owl') > -1; }; $.event.special[object.name].owl = true; } } else if (object.type === Owl.Type.State) { if (!this._states.tags[object.name]) { this._states.tags[object.name] = object.tags; } else { this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags); } this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) { return $.inArray(tag, this._states.tags[object.name]) === i; }, this)); } }; /** * Suppresses events. * @protected * @param {Array.} events - The events to suppress. */ Owl.prototype.suppress = function(events) { $.each(events, $.proxy(function(index, event) { this._supress[event] = true; }, this)); }; /** * Releases suppressed events. * @protected * @param {Array.} events - The events to release. */ Owl.prototype.release = function(events) { $.each(events, $.proxy(function(index, event) { delete this._supress[event]; }, this)); }; /** * Gets unified pointer coordinates from event. * @todo #261 * @protected * @param {Event} - The `mousedown` or `touchstart` event. * @returns {Object} - Contains `x` and `y` coordinates of current pointer position. */ Owl.prototype.pointer = function(event) { var result = { x: null, y: null }; event = event.originalEvent || event || window.event; event = event.touches && event.touches.length ? event.touches[0] : event.changedTouches && event.changedTouches.length ? event.changedTouches[0] : event; if (event.pageX) { result.x = event.pageX; result.y = event.pageY; } else { result.x = event.clientX; result.y = event.clientY; } return result; }; /** * Determines if the input is a Number or something that can be coerced to a Number * @protected * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number */ Owl.prototype.isNumeric = function(number) { return !isNaN(parseFloat(number)); }; /** * Gets the difference of two vectors. * @todo #261 * @protected * @param {Object} - The first vector. * @param {Object} - The second vector. * @returns {Object} - The difference. */ Owl.prototype.difference = function(first, second) { return { x: first.x - second.x, y: first.y - second.y }; }; /** * The jQuery Plugin for the Owl Carousel * @todo Navigation plugin `next` and `prev` * @public */ $.fn.owlCarousel = function(option) { var args = Array.prototype.slice.call(arguments, 1); return this.each(function() { var $this = $(this), data = $this.data('owl.carousel'); if (!data) { data = new Owl(this, typeof option == 'object' && option); $this.data('owl.carousel', data); $.each([ 'next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove' ], function(i, event) { data.register({ type: Owl.Type.Event, name: event }); data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) { if (e.namespace && e.relatedTarget !== this) { this.suppress([ event ]); data[event].apply(this, [].slice.call(arguments, 1)); this.release([ event ]); } }, data)); }); } if (typeof option == 'string' && option.charAt(0) !== '_') { data[option].apply(data, args); } }); }; /** * The constructor for the jQuery Plugin * @public */ $.fn.owlCarousel.Constructor = Owl; })(window.Zepto || window.jQuery, window, document); /** * AutoRefresh Plugin * @version 2.1.0 * @author Artus Kolanowski * @author David Deutsch * @license The MIT License (MIT) */ ;(function($, window, document, undefined) { /** * Creates the auto refresh plugin. * @class The Auto Refresh Plugin * @param {Owl} carousel - The Owl Carousel */ var AutoRefresh = function(carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this._core = carousel; /** * Refresh interval. * @protected * @type {number} */ this._interval = null; /** * Whether the element is currently visible or not. * @protected * @type {Boolean} */ this._visible = null; /** * All event handlers. * @protected * @type {Object} */ this._handlers = { 'initialized.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.settings.autoRefresh) { this.watch(); } }, this) }; // set default options this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options); // register event handlers this._core.$element.on(this._handlers); }; /** * Default options. * @public */ AutoRefresh.Defaults = { autoRefresh: true, autoRefreshInterval: 500 }; /** * Watches the element. */ AutoRefresh.prototype.watch = function() { if (this._interval) { return; } this._visible = this._core.$element.is(':visible'); this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval); }; /** * Refreshes the element. */ AutoRefresh.prototype.refresh = function() { if (this._core.$element.is(':visible') === this._visible) { return; } this._visible = !this._visible; this._core.$element.toggleClass('owl-hidden', !this._visible); this._visible && (this._core.invalidate('width') && this._core.refresh()); }; /** * Destroys the plugin. */ AutoRefresh.prototype.destroy = function() { var handler, property; window.clearInterval(this._interval); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh; })(window.Zepto || window.jQuery, window, document); /** * Lazy Plugin * @version 2.1.0 * @author Bartosz Wojciechowski * @author David Deutsch * @license The MIT License (MIT) */ ;(function($, window, document, undefined) { /** * Creates the lazy plugin. * @class The Lazy Plugin * @param {Owl} carousel - The Owl Carousel */ var Lazy = function(carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this._core = carousel; /** * Already loaded items. * @protected * @type {Array.} */ this._loaded = []; /** * Event handlers. * @protected * @type {Object} */ this._handlers = { 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) { if (!e.namespace) { return; } if (!this._core.settings || !this._core.settings.lazyLoad) { return; } if ((e.property && e.property.name == 'position') || e.type == 'initialized') { var settings = this._core.settings, n = (settings.center && Math.ceil(settings.items / 2) || settings.items), i = ((settings.center && n * -1) || 0), position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i, clones = this._core.clones().length, load = $.proxy(function(i, v) { this.load(v) }, this); while (i++ < n) { this.load(clones / 2 + this._core.relative(position)); clones && $.each(this._core.clones(this._core.relative(position)), load); position++; } } }, this) }; // set the default options this._core.options = $.extend({}, Lazy.Defaults, this._core.options); // register event handler this._core.$element.on(this._handlers); }; /** * Default options. * @public */ Lazy.Defaults = { lazyLoad: false }; /** * Loads all resources of an item at the specified position. * @param {Number} position - The absolute position of the item. * @protected */ Lazy.prototype.load = function(position) { var $item = this._core.$stage.children().eq(position), $elements = $item && $item.find('.owl-lazy'); if (!$elements || $.inArray($item.get(0), this._loaded) > -1) { return; } $elements.each($.proxy(function(index, element) { var $element = $(element), image, url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src'); this._core.trigger('load', { element: $element, url: url }, 'lazy'); if ($element.is('img')) { $element.one('load.owl.lazy', $.proxy(function() { $element.css('opacity', 1); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this)).attr('src', url); } else { image = new Image(); image.onload = $.proxy(function() { $element.css({ 'background-image': 'url("' + url + '")', 'opacity': '1' }); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this); image.src = url; } }, this)); this._loaded.push($item.get(0)); }; /** * Destroys the plugin. * @public */ Lazy.prototype.destroy = function() { var handler, property; for (handler in this.handlers) { this._core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy; })(window.Zepto || window.jQuery, window, document); /** * AutoHeight Plugin * @version 2.1.0 * @author Bartosz Wojciechowski * @author David Deutsch * @license The MIT License (MIT) */ ;(function($, window, document, undefined) { /** * Creates the auto height plugin. * @class The Auto Height Plugin * @param {Owl} carousel - The Owl Carousel */ var AutoHeight = function(carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this._core = carousel; /** * All event handlers. * @protected * @type {Object} */ this._handlers = { 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.settings.autoHeight) { this.update(); } }, this), 'changed.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.settings.autoHeight && e.property.name == 'position'){ this.update(); } }, this), 'loaded.owl.lazy': $.proxy(function(e) { if (e.namespace && this._core.settings.autoHeight && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) { this.update(); } }, this) }; // set default options this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options); // register event handlers this._core.$element.on(this._handlers); }; /** * Default options. * @public */ AutoHeight.Defaults = { autoHeight: false, autoHeightClass: 'owl-height' }; /** * Updates the view. */ AutoHeight.prototype.update = function() { var start = this._core._current, end = start + this._core.settings.items, visible = this._core.$stage.children().toArray().slice(start, end), heights = [], maxheight = 0; $.each(visible, function(index, item) { heights.push($(item).height()); }); maxheight = Math.max.apply(null, heights); this._core.$stage.parent() .height(maxheight) .addClass(this._core.settings.autoHeightClass); }; AutoHeight.prototype.destroy = function() { var handler, property; for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight; })(window.Zepto || window.jQuery, window, document); /** * Video Plugin * @version 2.1.0 * @author Bartosz Wojciechowski * @author David Deutsch * @license The MIT License (MIT) */ ;(function($, window, document, undefined) { /** * Creates the video plugin. * @class The Video Plugin * @param {Owl} carousel - The Owl Carousel */ var Video = function(carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this._core = carousel; /** * Cache all video URLs. * @protected * @type {Object} */ this._videos = {}; /** * Current playing item. * @protected * @type {jQuery} */ this._playing = null; /** * All event handlers. * @todo The cloned content removale is too late * @protected * @type {Object} */ this._handlers = { 'initialized.owl.carousel': $.proxy(function(e) { if (e.namespace) { this._core.register({ type: 'state', name: 'playing', tags: [ 'interacting' ] }); } }, this), 'resize.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.settings.video && this.isInFullScreen()) { e.preventDefault(); } }, this), 'refreshed.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.is('resizing')) { this._core.$stage.find('.cloned .owl-video-frame').remove(); } }, this), 'changed.owl.carousel': $.proxy(function(e) { if (e.namespace && e.property.name === 'position' && this._playing) { this.stop(); } }, this), 'prepared.owl.carousel': $.proxy(function(e) { if (!e.namespace) { return; } var $element = $(e.content).find('.owl-video'); if ($element.length) { $element.css('display', 'none'); this.fetch($element, $(e.content)); } }, this) }; // set default options this._core.options = $.extend({}, Video.Defaults, this._core.options); // register event handlers this._core.$element.on(this._handlers); this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) { this.play(e); }, this)); }; /** * Default options. * @public */ Video.Defaults = { video: false, videoHeight: false, videoWidth: false }; /** * Gets the video ID and the type (YouTube/Vimeo/vzaar only). * @protected * @param {jQuery} target - The target containing the video data. * @param {jQuery} item - The item containing the video. */ Video.prototype.fetch = function(target, item) { var type = (function() { if (target.attr('data-vimeo-id')) { return 'vimeo'; } else if (target.attr('data-vzaar-id')) { return 'vzaar' } else { return 'youtube'; } })(), id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'), width = target.attr('data-width') || this._core.settings.videoWidth, height = target.attr('data-height') || this._core.settings.videoHeight, url = target.attr('href'); if (url) { /* Parses the id's out of the following urls (and probably more): https://www.youtube.com/watch?v=:id https://youtu.be/:id https://vimeo.com/:id https://vimeo.com/channels/:channel/:id https://vimeo.com/groups/:group/videos/:id https://app.vzaar.com/videos/:id Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F */ id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); if (id[3].indexOf('youtu') > -1) { type = 'youtube'; } else if (id[3].indexOf('vimeo') > -1) { type = 'vimeo'; } else if (id[3].indexOf('vzaar') > -1) { type = 'vzaar'; } else { throw new Error('Video URL not supported.'); } id = id[6]; } else { throw new Error('Missing video URL.'); } this._videos[url] = { type: type, id: id, width: width, height: height }; item.attr('data-video', url); this.thumbnail(target, this._videos[url]); }; /** * Creates video thumbnail. * @protected * @param {jQuery} target - The target containing the video data. * @param {Object} info - The video info object. * @see `fetch` */ Video.prototype.thumbnail = function(target, video) { var tnLink, icon, path, dimensions = video.width && video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"' : '', customTn = target.find('img'), srcType = 'src', lazyClass = '', settings = this._core.settings, create = function(path) { icon = '
'; if (settings.lazyLoad) { tnLink = '
'; } else { tnLink = '
'; } target.after(tnLink); target.after(icon); }; // wrap video content into owl-video-wrapper div target.wrap('
'); if (this._core.settings.lazyLoad) { srcType = 'data-src'; lazyClass = 'owl-lazy'; } // custom thumbnail if (customTn.length) { create(customTn.attr(srcType)); customTn.remove(); return false; } if (video.type === 'youtube') { path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; create(path); } else if (video.type === 'vimeo') { $.ajax({ type: 'GET', url: '//vimeo.com/api/v2/video/' + video.id + '.json', jsonp: 'callback', dataType: 'jsonp', success: function(data) { path = data[0].thumbnail_large; create(path); } }); } else if (video.type === 'vzaar') { $.ajax({ type: 'GET', url: '//vzaar.com/api/videos/' + video.id + '.json', jsonp: 'callback', dataType: 'jsonp', success: function(data) { path = data.framegrab_url; create(path); } }); } }; /** * Stops the current video. * @public */ Video.prototype.stop = function() { this._core.trigger('stop', null, 'video'); this._playing.find('.owl-video-frame').remove(); this._playing.removeClass('owl-video-playing'); this._playing = null; this._core.leave('playing'); this._core.trigger('stopped', null, 'video'); }; /** * Starts the current video. * @public * @param {Event} event - The event arguments. */ Video.prototype.play = function(event) { var target = $(event.target), item = target.closest('.' + this._core.settings.itemClass), video = this._videos[item.attr('data-video')], width = video.width || '100%', height = video.height || this._core.$stage.height(), html; if (this._playing) { return; } this._core.enter('playing'); this._core.trigger('play', null, 'video'); item = this._core.items(this._core.relative(item.index())); this._core.reset(item.index()); if (video.type === 'youtube') { html = ''; } else if (video.type === 'vimeo') { html = ''; } else if (video.type === 'vzaar') { html = ''; } $('
' + html + '
').insertAfter(item.find('.owl-video')); this._playing = item.addClass('owl-video-playing'); }; /** * Checks whether an video is currently in full screen mode or not. * @todo Bad style because looks like a readonly method but changes members. * @protected * @returns {Boolean} */ Video.prototype.isInFullScreen = function() { var element = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; return element && $(element).parent().hasClass('owl-video-frame'); }; /** * Destroys the plugin. */ Video.prototype.destroy = function() { var handler, property; this._core.$element.off('click.owl.video'); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.Video = Video; })(window.Zepto || window.jQuery, window, document); /** * Animate Plugin * @version 2.1.0 * @author Bartosz Wojciechowski * @author David Deutsch * @license The MIT License (MIT) */ ;(function($, window, document, undefined) { /** * Creates the animate plugin. * @class The Navigation Plugin * @param {Owl} scope - The Owl Carousel */ var Animate = function(scope) { this.core = scope; this.core.options = $.extend({}, Animate.Defaults, this.core.options); this.swapping = true; this.previous = undefined; this.next = undefined; this.handlers = { 'change.owl.carousel': $.proxy(function(e) { if (e.namespace && e.property.name == 'position') { this.previous = this.core.current(); this.next = e.property.value; } }, this), 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) { if (e.namespace) { this.swapping = e.type == 'translated'; } }, this), 'translate.owl.carousel': $.proxy(function(e) { if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) { this.swap(); } }, this) }; this.core.$element.on(this.handlers); }; /** * Default options. * @public */ Animate.Defaults = { animateOut: false, animateIn: false }; /** * Toggles the animation classes whenever an translations starts. * @protected * @returns {Boolean|undefined} */ Animate.prototype.swap = function() { if (this.core.settings.items !== 1) { return; } if (!$.support.animation || !$.support.transition) { return; } this.core.speed(0); var left, clear = $.proxy(this.clear, this), previous = this.core.$stage.children().eq(this.previous), next = this.core.$stage.children().eq(this.next), incoming = this.core.settings.animateIn, outgoing = this.core.settings.animateOut; if (this.core.current() === this.previous) { return; } if (outgoing) { left = this.core.coordinates(this.previous) - this.core.coordinates(this.next); previous.one($.support.animation.end, clear) .css( { 'left': left + 'px' } ) .addClass('animated owl-animated-out') .addClass(outgoing); } if (incoming) { next.one($.support.animation.end, clear) .addClass('animated owl-animated-in') .addClass(incoming); } }; Animate.prototype.clear = function(e) { $(e.target).css( { 'left': '' } ) .removeClass('animated owl-animated-out owl-animated-in') .removeClass(this.core.settings.animateIn) .removeClass(this.core.settings.animateOut); this.core.onTransitionEnd(); }; /** * Destroys the plugin. * @public */ Animate.prototype.destroy = function() { var handler, property; for (handler in this.handlers) { this.core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.Animate = Animate; })(window.Zepto || window.jQuery, window, document); /** * Autoplay Plugin * @version 2.1.0 * @author Bartosz Wojciechowski * @author Artus Kolanowski * @author David Deutsch * @license The MIT License (MIT) */ ;(function($, window, document, undefined) { /** * Creates the autoplay plugin. * @class The Autoplay Plugin * @param {Owl} scope - The Owl Carousel */ var Autoplay = function(carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this._core = carousel; /** * The autoplay timeout. * @type {Timeout} */ this._timeout = null; /** * Indicates whenever the autoplay is paused. * @type {Boolean} */ this._paused = false; /** * All event handlers. * @protected * @type {Object} */ this._handlers = { 'changed.owl.carousel': $.proxy(function(e) { if (e.namespace && e.property.name === 'settings') { if (this._core.settings.autoplay) { this.play(); } else { this.stop(); } } else if (e.namespace && e.property.name === 'position') { //console.log('play?', e); if (this._core.settings.autoplay) { this._setAutoPlayInterval(); } } }, this), 'initialized.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.settings.autoplay) { this.play(); } }, this), 'play.owl.autoplay': $.proxy(function(e, t, s) { if (e.namespace) { this.play(t, s); } }, this), 'stop.owl.autoplay': $.proxy(function(e) { if (e.namespace) { this.stop(); } }, this), 'mouseover.owl.autoplay': $.proxy(function() { if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { this.pause(); } }, this), 'mouseleave.owl.autoplay': $.proxy(function() { if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { this.play(); } }, this), 'touchstart.owl.core': $.proxy(function() { if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { this.pause(); } }, this), 'touchend.owl.core': $.proxy(function() { if (this._core.settings.autoplayHoverPause) { this.play(); } }, this) }; // register event handlers this._core.$element.on(this._handlers); // set default options this._core.options = $.extend({}, Autoplay.Defaults, this._core.options); }; /** * Default options. * @public */ Autoplay.Defaults = { autoplay: false, autoplayTimeout: 5000, autoplayHoverPause: false, autoplaySpeed: false }; /** * Starts the autoplay. * @public * @param {Number} [timeout] - The interval before the next animation starts. * @param {Number} [speed] - The animation speed for the animations. */ Autoplay.prototype.play = function(timeout, speed) { this._paused = false; if (this._core.is('rotating')) { return; } this._core.enter('rotating'); this._setAutoPlayInterval(); }; /** * Gets a new timeout * @private * @param {Number} [timeout] - The interval before the next animation starts. * @param {Number} [speed] - The animation speed for the animations. * @return {Timeout} */ Autoplay.prototype._getNextTimeout = function(timeout, speed) { if ( this._timeout ) { window.clearTimeout(this._timeout); } return window.setTimeout($.proxy(function() { if (this._paused || this._core.is('busy') || this._core.is('interacting') || document.hidden) { return; } this._core.next(speed || this._core.settings.autoplaySpeed); }, this), timeout || this._core.settings.autoplayTimeout); }; /** * Sets autoplay in motion. * @private */ Autoplay.prototype._setAutoPlayInterval = function() { this._timeout = this._getNextTimeout(); }; /** * Stops the autoplay. * @public */ Autoplay.prototype.stop = function() { if (!this._core.is('rotating')) { return; } window.clearTimeout(this._timeout); this._core.leave('rotating'); }; /** * Stops the autoplay. * @public */ Autoplay.prototype.pause = function() { if (!this._core.is('rotating')) { return; } this._paused = true; }; /** * Destroys the plugin. */ Autoplay.prototype.destroy = function() { var handler, property; this.stop(); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay; })(window.Zepto || window.jQuery, window, document); /** * Navigation Plugin * @version 2.1.0 * @author Artus Kolanowski * @author David Deutsch * @license The MIT License (MIT) */ ;(function($, window, document, undefined) { 'use strict'; /** * Creates the navigation plugin. * @class The Navigation Plugin * @param {Owl} carousel - The Owl Carousel. */ var Navigation = function(carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this._core = carousel; /** * Indicates whether the plugin is initialized or not. * @protected * @type {Boolean} */ this._initialized = false; /** * The current paging indexes. * @protected * @type {Array} */ this._pages = []; /** * All DOM elements of the user interface. * @protected * @type {Object} */ this._controls = {}; /** * Markup for an indicator. * @protected * @type {Array.} */ this._templates = []; /** * The carousel element. * @type {jQuery} */ this.$element = this._core.$element; /** * Overridden methods of the carousel. * @protected * @type {Object} */ this._overrides = { next: this._core.next, prev: this._core.prev, to: this._core.to }; /** * All event handlers. * @protected * @type {Object} */ this._handlers = { 'prepared.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.settings.dotsData) { this._templates.push('
' + $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '
'); } }, this), 'added.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.settings.dotsData) { this._templates.splice(e.position, 0, this._templates.pop()); } }, this), 'remove.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.settings.dotsData) { this._templates.splice(e.position, 1); } }, this), 'changed.owl.carousel': $.proxy(function(e) { if (e.namespace && e.property.name == 'position') { this.draw(); } }, this), 'initialized.owl.carousel': $.proxy(function(e) { if (e.namespace && !this._initialized) { this._core.trigger('initialize', null, 'navigation'); this.initialize(); this.update(); this.draw(); this._initialized = true; this._core.trigger('initialized', null, 'navigation'); } }, this), 'refreshed.owl.carousel': $.proxy(function(e) { if (e.namespace && this._initialized) { this._core.trigger('refresh', null, 'navigation'); this.update(); this.draw(); this._core.trigger('refreshed', null, 'navigation'); } }, this) }; // set default options this._core.options = $.extend({}, Navigation.Defaults, this._core.options); // register event handlers this.$element.on(this._handlers); }; /** * Default options. * @public * @todo Rename `slideBy` to `navBy` */ Navigation.Defaults = { nav: false, navText: [ 'prev', 'next' ], navSpeed: false, navElement: 'div', navContainer: false, navContainerClass: 'owl-nav', navClass: [ 'owl-prev', 'owl-next' ], slideBy: 1, dotClass: 'owl-dot', dotsClass: 'owl-dots', dots: true, dotsEach: false, dotsData: false, dotsSpeed: false, dotsContainer: false }; /** * Initializes the layout of the plugin and extends the carousel. * @protected */ Navigation.prototype.initialize = function() { var override, settings = this._core.settings; // create DOM structure for relative navigation this._controls.$relative = (settings.navContainer ? $(settings.navContainer) : $('
').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); this._controls.$previous = $('<' + settings.navElement + '>') .addClass(settings.navClass[0]) .html(settings.navText[0]) .prependTo(this._controls.$relative) .on('click', $.proxy(function(e) { this.prev(settings.navSpeed); }, this)); this._controls.$next = $('<' + settings.navElement + '>') .addClass(settings.navClass[1]) .html(settings.navText[1]) .appendTo(this._controls.$relative) .on('click', $.proxy(function(e) { this.next(settings.navSpeed); }, this)); // create DOM structure for absolute navigation if (!settings.dotsData) { this._templates = [ $('
') .addClass(settings.dotClass) .append($('')) .prop('outerHTML') ]; } this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer) : $('
').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled'); this._controls.$absolute.on('click', 'div', $.proxy(function(e) { var index = $(e.target).parent().is(this._controls.$absolute) ? $(e.target).index() : $(e.target).parent().index(); e.preventDefault(); this.to(index, settings.dotsSpeed); }, this)); // override public methods of the carousel for (override in this._overrides) { this._core[override] = $.proxy(this[override], this); } }; /** * Destroys the plugin. * @protected */ Navigation.prototype.destroy = function() { var handler, control, property, override; for (handler in this._handlers) { this.$element.off(handler, this._handlers[handler]); } for (control in this._controls) { this._controls[control].remove(); } for (override in this.overides) { this._core[override] = this._overrides[override]; } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; /** * Updates the internal state. * @protected */ Navigation.prototype.update = function() { var i, j, k, lower = this._core.clones().length / 2, upper = lower + this._core.items().length, maximum = this._core.maximum(true), settings = this._core.settings, size = settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items; if (settings.slideBy !== 'page') { settings.slideBy = Math.min(settings.slideBy, settings.items); } if (settings.dots || settings.slideBy == 'page') { this._pages = []; for (i = lower, j = 0, k = 0; i < upper; i++) { if (j >= size || j === 0) { this._pages.push({ start: Math.min(maximum, i - lower), end: i - lower + size - 1 }); if (Math.min(maximum, i - lower) === maximum) { break; } j = 0, ++k; } j += this._core.mergers(this._core.relative(i)); } } }; /** * Draws the user interface. * @todo The option `dotsData` wont work. * @protected */ Navigation.prototype.draw = function() { var difference, settings = this._core.settings, disabled = this._core.items().length <= settings.items, index = this._core.relative(this._core.current()), loop = settings.loop || settings.rewind; this._controls.$relative.toggleClass('disabled', !settings.nav || disabled); if (settings.nav) { this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true)); this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true)); } this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled); if (settings.dots) { difference = this._pages.length - this._controls.$absolute.children().length; if (settings.dotsData && difference !== 0) { this._controls.$absolute.html(this._templates.join('')); } else if (difference > 0) { this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0])); } else if (difference < 0) { this._controls.$absolute.children().slice(difference).remove(); } this._controls.$absolute.find('.active').removeClass('active'); this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active'); } }; /** * Extends event data. * @protected * @param {Event} event - The event object which gets thrown. */ Navigation.prototype.onTrigger = function(event) { var settings = this._core.settings; event.page = { index: $.inArray(this.current(), this._pages), count: this._pages.length, size: settings && (settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items) }; }; /** * Gets the current page position of the carousel. * @protected * @returns {Number} */ Navigation.prototype.current = function() { var current = this._core.relative(this._core.current()); return $.grep(this._pages, $.proxy(function(page, index) { return page.start <= current && page.end >= current; }, this)).pop(); }; /** * Gets the current succesor/predecessor position. * @protected * @returns {Number} */ Navigation.prototype.getPosition = function(successor) { var position, length, settings = this._core.settings; if (settings.slideBy == 'page') { position = $.inArray(this.current(), this._pages); length = this._pages.length; successor ? ++position : --position; position = this._pages[((position % length) + length) % length].start; } else { position = this._core.relative(this._core.current()); length = this._core.items().length; successor ? position += settings.slideBy : position -= settings.slideBy; } return position; }; /** * Slides to the next item or page. * @public * @param {Number} [speed=false] - The time in milliseconds for the transition. */ Navigation.prototype.next = function(speed) { $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed); }; /** * Slides to the previous item or page. * @public * @param {Number} [speed=false] - The time in milliseconds for the transition. */ Navigation.prototype.prev = function(speed) { $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed); }; /** * Slides to the specified item or page. * @public * @param {Number} position - The position of the item or page. * @param {Number} [speed] - The time in milliseconds for the transition. * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not. */ Navigation.prototype.to = function(position, speed, standard) { var length; if (!standard && this._pages.length) { length = this._pages.length; $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed); } else { $.proxy(this._overrides.to, this._core)(position, speed); } }; $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation; })(window.Zepto || window.jQuery, window, document); /** * Hash Plugin * @version 2.1.0 * @author Artus Kolanowski * @author David Deutsch * @license The MIT License (MIT) */ ;(function($, window, document, undefined) { 'use strict'; /** * Creates the hash plugin. * @class The Hash Plugin * @param {Owl} carousel - The Owl Carousel */ var Hash = function(carousel) { /** * Reference to the core. * @protected * @type {Owl} */ this._core = carousel; /** * Hash index for the items. * @protected * @type {Object} */ this._hashes = {}; /** * The carousel element. * @type {jQuery} */ this.$element = this._core.$element; /** * All event handlers. * @protected * @type {Object} */ this._handlers = { 'initialized.owl.carousel': $.proxy(function(e) { if (e.namespace && this._core.settings.startPosition === 'URLHash') { $(window).trigger('hashchange.owl.navigation'); } }, this), 'prepared.owl.carousel': $.proxy(function(e) { if (e.namespace) { var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash'); if (!hash) { return; } this._hashes[hash] = e.content; } }, this), 'changed.owl.carousel': $.proxy(function(e) { if (e.namespace && e.property.name === 'position') { var current = this._core.items(this._core.relative(this._core.current())), hash = $.map(this._hashes, function(item, hash) { return item === current ? hash : null; }).join(); if (!hash || window.location.hash.slice(1) === hash) { return; } window.location.hash = hash; } }, this) }; // set default options this._core.options = $.extend({}, Hash.Defaults, this._core.options); // register the event handlers this.$element.on(this._handlers); // register event listener for hash navigation $(window).on('hashchange.owl.navigation', $.proxy(function(e) { var hash = window.location.hash.substring(1), items = this._core.$stage.children(), position = this._hashes[hash] && items.index(this._hashes[hash]); if (position === undefined || position === this._core.current()) { return; } this._core.to(this._core.relative(position), false, true); }, this)); }; /** * Default options. * @public */ Hash.Defaults = { URLhashListener: false }; /** * Destroys the plugin. * @public */ Hash.prototype.destroy = function() { var handler, property; $(window).off('hashchange.owl.navigation'); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null); } }; $.fn.owlCarousel.Constructor.Plugins.Hash = Hash; })(window.Zepto || window.jQuery, window, document); /** * Support Plugin * * @version 2.1.0 * @author Vivid Planet Software GmbH * @author Artus Kolanowski * @author David Deutsch * @license The MIT License (MIT) */ ;(function($, window, document, undefined) { var style = $('').get(0).style, prefixes = 'Webkit Moz O ms'.split(' '), events = { transition: { end: { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd', transition: 'transitionend' } }, animation: { end: { WebkitAnimation: 'webkitAnimationEnd', MozAnimation: 'animationend', OAnimation: 'oAnimationEnd', animation: 'animationend' } } }, tests = { csstransforms: function() { return !!test('transform'); }, csstransforms3d: function() { return !!test('perspective'); }, csstransitions: function() { return !!test('transition'); }, cssanimations: function() { return !!test('animation'); } }; function test(property, prefixed) { var result = false, upper = property.charAt(0).toUpperCase() + property.slice(1); $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) { if (style[property] !== undefined) { result = prefixed ? property : true; return false; } }); return result; } function prefixed(property) { return test(property, true); } if (tests.csstransitions()) { /* jshint -W053 */ $.support.transition = new String(prefixed('transition')) $.support.transition.end = events.transition.end[ $.support.transition ]; } if (tests.cssanimations()) { /* jshint -W053 */ $.support.animation = new String(prefixed('animation')) $.support.animation.end = events.animation.end[ $.support.animation ]; } if (tests.csstransforms()) { /* jshint -W053 */ $.support.transform = new String(prefixed('transform')); $.support.transform3d = tests.csstransforms3d(); } })(window.Zepto || window.jQuery, window, document); // source --> https://www.opiceblum.com.br/en/wp-content/plugins/spker-core/assets/js/libs/modernizr.custom.js?ver=1.9.3 /* Modernizr 2.6.2 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-csstransforms3d-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load */ ;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.csstransforms3d=function(){var a=!!F("perspective");return a&&"webkitPerspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f https://www.opiceblum.com.br/en/wp-content/plugins/spker-core/assets/js/carousel.js?ver=5.3.16 "use strict";function _classCallCheck(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}var _extends=Object.assign||function(a){for(var t=1;t',i=0,l=!0,s=!1,u=void 0;try{for(var d,r=t[Symbol.iterator]();!(l=(d=r.next()).done);l=!0){var m=d.value;o+='
\n \n
',i++}}catch(a){s=!0,u=a}finally{try{!l&&r.return&&r.return()}finally{if(s)throw u}}o+="
",a.after(o);var c=a.next();this._setupOwlCarousel(c)}}]),t}();a(document).ready(function(){new t})}(jQuery); //# sourceMappingURL=carousel.js.map;